我使用Chrome 43中的Ajax将HTTP跨域POST
请求发送到具有标头Access-Control-Allow-Origin:*
的服务器,Chrome在devtools中记录消息,如下所示:
XMLHttpRequest cannot load http://172.65.34.13/v1/image/upload. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:6032' is therefore not allowed access. The response had HTTP status code 400.
响应标题:
HTTP/1.1 400 Bad Request
Server: nginx/1.9.4
Date: Thu, 27 Aug 2015 02:05:46 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 105
Connection: keep-alive
Set-Cookie: sessionid=39b9608771e38408b2f1278621805514; Path=/; HttpOnly
但最奇怪的是服务器确实收到了我的帖子数据!怎么会这样?我错过了有关请求或服务器的内容吗?任何人都可以帮我解决这个问题吗?