我已经设置好了一个Web服务器,并提供了一条路由。当我使用curl
访问时,我得到以下结果:
$ curl -i -X POST http://dev.com:5000/user/check
HTTP/1.0 200 OK
Content-Type: application/json
Content-Length: 40
Access-Control-Allow-Origin: *
Vary: Cookie
Set-Cookie: session=eyJjaGVjayI6dHJ1ZX0.Dij_Ng.OL7a0pycpZgU45zEIzC5ZTfeCdk; Domain=.dev.com; HttpOnly; Path=/
Server: Werkzeug/0.14.1 Python/3.6.5
Date: Thu, 12 Jul 2018 15:03:18 GMT
{
"result": null,
"status": "ok"
}
当我在Chrome中运行时,调试控制台报告如下: 常规
Request URL: http://dev.com:5000/user/check
Request Method: POST
Status Code: 200 OK
Remote Address: 127.0.0.1:5000
Referrer Policy: no-referrer-when-downgrade
响应头
Access-Control-Allow-Origin: http://localhost:8080
Content-Length: 40
Content-Type: application/json
Date: Thu, 12 Jul 2018 15:04:10 GMT
Server: Werkzeug/0.14.1 Python/3.6.5
Vary: Origin, Cookie
请求头
Provisional headers are shown
Accept: application/json, text/plain, */*
Origin: http://localhost:8080
Referer: http://localhost:8080/
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36
没有返回任何cookie,发生了什么事情?