[Computer network-application layer] HTTP protocol

1. Overview of the World Wide Web

Insert picture description here

2. HTTP

Insert picture description here

2.1 Features of HTTP

The same customer has no record of visiting the same website

Stateless

Insert picture description here

2.2 HTTP connection method

2.2.1 Non-persistent connection

Request three connections, that is, connect based on TCP

If you send data again, you need to go through three handshake again
Insert picture description here

2.2.2 Persistent connection

Non-pipelined: you send it to me, I will send it to you

Pipeline: continuous transmission
Insert picture description here

Message structure

Request message

Insert picture description here
Method : Command
URL : Identifier
Version : What version of the HTTP protocol
Header line : Some information about the browser, server, and message body

Insert picture description here
Connection: indicates that the current is a non-persistent connection
Cookie: indicates that you have visited

Response message

Insert picture description here
Insert picture description here

  • Start with 1: indicate notification message
  • 2 starts with: indicates success. 202 Accepted
  • 3 beginning: indicates redirection, further action must be taken to complete the request
  • 4 beginning: indicates the customer's error, the request has an incorrect grammar can not complete 404
  • Start with 5: indicates the server's error, such as server failure and unable to complete the request

Guess you like

Origin blog.csdn.net/qq_40915439/article/details/108210225