http-data-structure

http-data-structure

五月 01, 2018

httpHeader

http header

http 数据结构

request

http data structure

GET /mix/76.html?name=kelvin&password=123456 HTTP/1.1

Host: www.fishbay.cn

Upgrade-Insecure-Requests: 1

User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8

Accept-Encoding: gzip, deflate, sdch

Accept-Language: zh-CN,zh;q=0.8,en;q=0.6

response

http data structure

HTTP/1.1 200 OK

Server: nginx

Date: Mon, 20 Feb 2017 09:13:59 GMT

Content-Type: text/plain;charset=UTF-8

Vary: Accept-Encoding

Cache-Control: no-store

Pragrma: no-cache

Expires: Thu, 01 Jan 1970 00:00:00 GMT

Cache-Control: no-cache

Content-Encoding: gzip

Transfer-Encoding: chunked

Proxy-Connection: Keep-alive

{“code”:200,”notice”:0,”follow”:0,”forward”:0,”msg”:0,”comment”:0,”pushMsg”:null,”friend”:{“snsCount”:0,”count”:0,”celebrityCount”:0},”lastPrivateMsg”:null,”event”:0,”newProgramCount”:0,”createDJRadioCount”:0,”newTheme”:true}

状态码

HTTP协议的状态码由3位数字组成,第一个数字定义了响应的类别,共有5中类别:

1.1xx: 指示信息–表示请求已接收,继续处理

2.2xx: 成功–表示请求已被成功接收、理解、接受

3.3xx: 重定向–要完成请求必须进行更进一步的操作

4.4xx: 客户端错误–请求有语法错误或请求无法实现

5.5xx: 服务器端错误–服务器未能实现合法的请求