axios跨域请求异常问题
前端代码:
axios({
method:"post",
url:"",
data:formData,
headers:{
'Content-Type':'multipart/form-data',
}
}).then(function(value){
}
);
后台设置响应头:
httpServletResponse.setHeader("Access-Control-Allow-Origin", "*");
httpServletResponse.setHeader("Access-Control-Allow-Headers", "Content-Type,Content-Length, Authorization, Accept,X-Requested-With");
httpServletResponse.setHeader("Access-Control-Allow-Methods","PUT,POST,GET,DELETE,OPTIONS");
httpServletResponse.setHeader("X-Powered-By","Jetty");