请求标头字段访问-控制-允许标头不允许访问-控制-允许标头我试图用POST请求将文件发送到服务器,但是当它发送时会导致错误:Request header field Content-Type is not allowed by Access-Control-Allow-Headers.因此,我搜索了错误并添加了标题:$http.post($rootScope.URL, {params: arguments}, {headers: {
"Access-Control-Allow-Origin" : "*",
"Access-Control-Allow-Methods" : "GET,POST,PUT,DELETE,OPTIONS",
"Access-Control-Allow-Headers": "Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With"}然后我得到错误:Request header field Access-Control-Allow-Origin is not allowed by Access-Control-Allow-Headers所以我在谷歌上搜索了这个问题,唯一一个类似的问题是提供了一个一半的答案,然后结束了这个话题。我应该添加/删除哪些标头?
3 回答
扬帆大鱼
TA贡献1799条经验 获得超9个赞
Access-Control-Allow-Headers
Content-Type
添加回答
举报
0/150
提交
取消