请求报文
Accept 开头
声明可接收的响应.
// 希望响应式 json 格式
Accept: application/json
// 支持 gzip 格式的压缩
Accept-Encoding: gzip, deflate
// 可以支持中/英文
Accept-Language: en,zh-CN;q=0.9,zh;q=0.8
Connection: keep-alive
// Accept 声明接收响应的类型
Accept: application/json
Accept-Encoding: gzip, deflate
Accept-Language: en,zh-CN;q=0.9,zh;q=0.8
//
Connection: keep-alive
Content-Length: 55
Content-Type: application/x-www-form-urlencoded; charset=utf-8
Cookie: JSESSIONID=98fd85d6-71da-4e30-b494-2f4c0dca4286; SERVERID=a1729b5697c753eff2e9f2c1da4da9ff|1581562886|1581562732
Host: we.zjhzyh.com
Origin: http://we.zjhzyh.com
Referer: http://we.zjhzyh.com/home/healthClock
User-Agent: Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Mobile Safari/537.36
temperature: 1000
health: 1
remark:
iscontact: 0
lng:
lat:
响应报文
Access-Control-Allow-Credentials: true
Access-Control-Allow-Origin: http://we.zjhzyh.com
Connection: keep-alive
Content-Type: application/json;charset=UTF-8
Date: Thu, 13 Feb 2020 03:05:48 GMT
EagleId: 249ed89c15815631481316427e
Server: Tengine
Set-Cookie: SERVERID=a1729b5697c753eff2e9f2c1da4da9ff|1581563148|1581562732;Path=/
Timing-Allow-Origin: *
Transfer-Encoding: chunked
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Via: cache25.l2et2[18,0], kunlun8.cn1568[40,0]
Request URL: http://we.zjhzyh.com/api/health/update
Request Method: POST
Status Code: 200
Remote Address: 36.158.216.229:80
Referrer Policy: no-referrer-when-downgrade
Set-Cookie
基本机制:
响应头中有Set-Cookie: username=JasonChi,那么浏览器会在当前页面所在域名设置cookie字符串。
仅在某个 Domain 下设置:
告诉浏览器给mayibank.net这个域下设置ctoken的cookie
Set-Cookie: ctoken=O5kWnZU24hNA4eJq; Domain=.mayibank.net; Path=/,