HTTP报文-HTTP

HTTP packets

Start Line: request start line, in response to the starting row
header (head): request header, response header, universal head
body: request body, response body

General Universal head

Request URL: http://www.zhufengpeixun.cn/  请求地址
Request Method: GET  请求方式:GET/POST/DELETE/PUT/HEAD/OPTION...
Status Code: 304 Not Modified   响应的HTTP状态码
Remote Address: 125.39.174.137:80  主机地址(服务器外网IP地址)
Referrer Policy: no-referrer-when-downgrade

Request Headers request header [client settings, the server receives]

GET / HTTP/1.1  =>起始行(描述当前请求的一些基本信息:用的是1.1版本传输协议进行内容传输的)
Host: www.zhufengpeixun.cn
Connection: keep-alive
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Cookie: ... =>cookie信息一般都是放到头文件中实现和服务器端的数据通信的
If-Modified-Since: Sun, 06 May 2018 10:02:42 GMT

Response Headers response header [settings server, the client obtains]

HTTP/1.1 304 Not Modified  =>响应起始行(HTTP状态码)
Date: Tue, 22 May 2018 09:18:56 GMT  =>服务器响应内容时候的“服务器端时间”(客户端获取这个时间的时候已经和真实的时间产生误差了,因为服务器返回内容到客户端接收到,也是需要时间的),并且这个时间是格林尼治时间(比北京时间慢8小时,北京时间是GMT+0800)
Connection: keep-alive
ETag: "700a6f-17f43-56b86a77513d3"
Vary: Accept-Encoding,User-Agent
Server: yunjiasu-nginx  //=>管理WEB服务的工具
CF-RAY: 41ee32c192db66b8-TSN

The Response [Response body]

Returned by the server is valid and what is

Request Payload / Form Data [request body]

The client is passed to the server

  1. Learn how to view the HTTP packets and to work to develop and debug BUG crucial for the future
    after it comes to interactive features (front-end <=> background) problems, find the cause of the problem are as follows
    A: Open the console in the NET-WORK to find the requested address of the current interaction, click to go to see the details
    B: If it is passed to parameters or how a server error [front-end problem]
    C: If the information returned by the server errors or interface and API documentation specified content is not the same [back problems]
    D: If the data is returned, but there are problems show [distal problem]

After determining that issue their own front-end, based on the breakpoint (or code debugger) or console output, etc., you can start stepping

  1. Client and server information exchange manner
    [the client to the server]
    A: a question mark parameter passing
    the end of the URL address requested by a question mark mass participation mode, some information to the server
    / stu / info id = 12 & lx = man?

    B: setting request header
    client needs to be passed to the content server header information setting request (custom request header), the server may request the header information obtained by receiving the content

    C: setting request body
    ([AJAX SEND passed in content, the main content is requested, the server may set the client information of the received]) xhr.send;

[Returned by the server to the client]
A: header information setting response
for example to service the client time to return to the first response, the client header information obtained by the acquisition response time (response speed of the head is returned in response to the priority of the body)

 B:设置响应主体
  主要的返回信息都在响应主体中

Guess you like

Origin www.cnblogs.com/wangshouren/p/11641139.html