1) Establish connection: client and server establish TCP connection
2) Send request: After a connection is opened, the client sends the request information to the appropriate port on the server and completes the request action submission.
3) Send response: The server sends a response message to the client after the client request has been processed.
4) Close the connection: both the client and server side can close the socket to end the TCP/IP conversation.
HTTP works by requesting and responding to messages. The simplest scenario is when a user enters a site address and sends a request. After that, the browser returns the requested page, which may be the simplest HTML page or a dynamically compiled page. If the page is wrong or does not exist, the Web server will send an incorrect information page.
The Web server sends an error Message page because HTTP does not have a built-in processing mechanism, is stateless, and the transport protocol does not remember any information from one request message to another request message (note: This means that when sending a request message An error occurs because HTTP is stateless, Therefore, this error message cannot be passed to another request message for processing, and the request message cannot be turned and must be uploaded and processed at one time to ensure consistency of the web. However, users often need to remember some of the settings or browsing process, which requires a Web page or URL to carry a variety of parameters and values. HTTP requests have multiple styles. There are get,post,head requests that are commonly used.
HTTP request Response Process