码迷,mamicode.com
首页 > 其他好文 > 详细

CORS 中的POST and OPTIONS 请求

时间:2016-05-30 14:18:58      阅读:175      评论:0      收藏:0      [点我收藏+]

标签:

Ajax 跨域访问post 请求,在服务器却得到的总是options请求

因为此post请求的 content-type不是one of the “application/x-www-form-urlencoded, multipart/form-data, or text/plain”, 所以Preflighted requests被发起。

“preflighted” requests first send an HTTP OPTIONS request header to the resource on the other domain, in order to determine whether the actual request is safe to send. 然后得到服务器response许可之后。

 

参考文章:

http://cnodejs.org/topic/519c234863e9f8a542aa7ebd

http://www.cnblogs.com/virtual/p/3720750.html

https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS

CORS 中的POST and OPTIONS 请求

标签:

原文地址:http://www.cnblogs.com/popzhou/p/5542206.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!