-1
我的角度使用$http
和我的代码是:当我更改内容类型为application/JSON我POST方法改变选项
$http({
method: 'POST',
url: url,
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
data: data,
}).then(function success(result){
});
这个Content-Type
我可以发送与POST
方法。
当我更改Content-Type
到application/json
我的POST
方法更改为OPTION
为什么???
我在Chrome和Firefox Developer上测试过,但在IE中工作正常!
应与内容类型无关...... OPTIONS请求由浏览器在发出跨源请求时完成。阅读CORS的内容 – charlietfl