http protocol - to understand the http protocol with Ethereal

First, start packet capture tool

Our package came with a chrome browser practice, chrome comes with a packet capture tool, press the F12 can call out.
As follows:
Here Insert Picture Description
Currently we are only concerned with the Network like
Here Insert Picture Description

Second, the use of tools

Open the record button
Here Insert Picture Description
after opening the absence of data requests, so there will be no reaction
Here Insert Picture Description
as long as it will re-request data in the following refresh the current page, it can be caught package.
Here Insert Picture Description

Third, data analysis

We can try to analyze the data simpler and easier to understand http operations.
Open the tomcat server and enter the page (do not know tomcat server partners around at other blog under the understanding of it)
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
after the official to find such an example,
Here Insert Picture Description
let's input data, but first, do not press submit:
Here Insert Picture Description
opener, red is launched :
Here Insert Picture Description
and then click the submit button, you can grab the data:
Here Insert Picture Description
click the box marked options:
Here Insert Picture Description
get:
Here Insert Picture Description
in the http protocol, the client needs to send the requested data, the requested data where it? Is that these two:
Here Insert Picture Description
Click the View:
Here Insert Picture Description
The current data is to reorganize the layout of the browser parses a view to facilitate our view, click the view sourse can view the original request data,
request data to understand the composition of the next

  1. Request line
  2. Request header
  3. Request body
    Here Insert Picture Description

Request line

  1. Request method
  2. address
  3. Protocol Version

Request header

  1. Accept (supported data types)
  2. Referer (request address)
  3. Accept-Language (language support)
  4. User-Agent (user information)
  5. Content-Type (content type)
  6. Accept-Encoding (compression algorithms)
  7. Host (host address)
  8. Content-Length (content length)
  9. Connection (connected state)
  10. Cache-Control (cache control)

Request body

What we really need is a data transmission using key-value pairs preserved. Among the plurality of key-value pairs separated by &.




After the request is made, the server response data will be sent to the client.
Here Insert Picture Description

Response line

Protocol version
status code
    commonly used with a status code:
    404: Not Found
    403: rejected for biddern
    500: Server Exception
Status Code Description

Response header

Server: Server Type
Content-Type: Content Type
Content-Length: length Content
Date: Response time

Published 41 original articles · won praise 15 · views 10000 +

Guess you like

Origin blog.csdn.net/weixin_43616178/article/details/102926050