2020-07-02 Java后端跨域设置

2020-07-02  本文已影响0人  lodtap

response.setContentType("application/octet-stream; charset=UTF-8");

response.setHeader("Access-Control-Allow-Origin","*");

 response.setHeader("Access-Control-Allow-Credentials", "true");

response.setHeader("Access-Control-Allow-Methods", "POST,GET,OPTIONS,DELETE,PATCH,PUT");

response.setHeader("Access-Control-Allow-Headers", "Origin,X-Requested-With,x-requested-with,X-Custom-Header," +"Content-Type,Accept,Authorization");

上一篇下一篇

猜你喜欢

热点阅读