HTTP network protocol package

Time:2022-5-13

Network protocol package:

1. All information transmitted in the network exists in binary

2. The first thing the receiver [browser / server] should do after receiving the information
That is to compile [binary data] [text, picture, video, command]

3. It is often difficult for the receiver to obtain a large amount of binary data
  For example, the browser sends a request: http://192.168.100.2:8080/index.html
     This request message is sent in binary form 0101010100111110101010101
     It is difficult for HTTP server to get relevant information from binary data
     
4. The network protocol package is a set of regular binary data, so that this set of data can be stored in a fixed space
  Each space is dedicated to storing specific information, so that after receiving the network protocol package
  The corresponding information can be obtained in the fixed space, and the emergence of network protocol packets is greatly reduced
  Compilation difficulty of binary data received by the receiver
  [0000 (IP address) 0000 (port number) 0000 (resource file name) 0000]

Common network protocols:

1. FTP network protocol package 
UDP network protocol

HTTP network protocol package:

In the process of Internet communication based on B / S structure, all the information transmitted in the network is stored in
 HTTP network protocol package
 
 Classification:
      HTTP request protocol package
      。
      HTTP response protocol package

HTTP request protocol package and response protocol package:

Http. Package request:
                  When the browser is ready to send a request, it is responsible for creating an HTTP request protocol package
                  The browser saves the request information in binary form in each space of the HTTP request protocol package
                  The browser is responsible for pushing the HTTP request protocol package to the specified server-side computer
 2. HTTP response protocol package:
                 The HTTP server locates the accessed resource file.
                 Responsible for creating an HTTP response protocol package
                 The HTTP server will locate the file contents or file commands to
                 The binary form is written to each space of the HTTP response protocol package
                 The HTTP server is responsible for pushing the HTTP response protocol packet back
                 On the browser that sent the request

Internal space of HTTP request protocol package:

1. According to the top-down division, it is divided into four spaces
2. Space division;
         Request line:[
                 URL: request address( http://192.168.100.2:8080/index.html )
                 Method: request method (post / get)
                ]
         Request header:[
                 Request parameter information [get]
                ]
         Blank line:[
                 Without any content, it plays a role of isolation
                ]
         Request body:[
                 Request parameter information [post]
                ]

Internal structure of response protocol package:

1.