asp.net webAPI POST方法的CORS跨域问题

端口不同会判断为不同域

Method Not Allowed 。

 

 web.config中设定·customHeaders

错误变化为

原因‘ post方法使用前会有一次OPTION方法的请求’

  解决:在controller中添加

解决。

 

posted @ 2018-12-17 14:40  朝日asahi  阅读(501)  评论(0编辑  收藏  举报