Frequently asked questions about HTTP

The difference between http and https

  • HTTPS = HTTP + SSL (Secure Socket Protocol)
  • https has a ca certificate, http generally does not
  • http is the hypertext transfer protocol, and the information is transmitted in clear text. https is a secure ssl encrypted transmission protocol
  • HTTP defaults to port 80, and https defaults to port 443.

The seven-layer model in the network layer (OSI)

  • Application layer: means of allowing access to the OSI environment
  • Data Link Layer: Defines how formatted data is transmitted in frames
  • Presentation layer: translates, encrypts, and compresses data
  • Session layer: establish, manage and terminate sessions
  • Transport layer: Provide end-to-end reliable message delivery and error recovery
  • Network layer: Responsible for the transmission of data packets from source to destination and Internet interconnection
  • Physical layer: transmits bits through the medium, determines mechanical and electrical specifications

What HTTP status codes do you know? What does separate mean?

  • 1xx means information, the server receives the request, and the requester needs to continue to perform the operation
  • 2xx indicates success, processing is complete
  • 3xx indicates that further action is required
  • 4xx indicates an error on the client side
  • 5xx indicates an error on the server side

2xx (3 types)

  • 200 OK: Indicates that the request sent from the client to the server is processed normally and returned;
  • 204 No Content: Indicates that the request sent by the client to the client has been successfully processed, but the returned response message does not contain the main part of the entity (no resource can be returned);
  • 206 Patial Content: Indicates that the client has made a range request, and the server has successfully executed this part of the GET request, and the response message contains the entity content of the range specified by Content-Range.

3xx (5 types)

  • 301 Moved Permanently: Permanent redirection, indicating that the requested resource is assigned a new URL, and the changed URL should be used afterwards;
  • 302 Found: Temporary redirection, indicating that the requested resource has been assigned a new URL, and it is hoped that this visit will use the new URL;
  • The difference between 301 and 302: the former is a permanent move, the latter is a temporary move (the URL may be changed later)
  • 303 See Other: Indicates that the requested resource has been assigned a new URL, and the GET method should be used to obtain the requested resource;
  • The difference between 302 and 303: the latter clearly indicates that the client should use GET to obtain resources
  • 304 Not Modified: Indicates that the client sends additional conditions (meaning that the request message using the GET method contains any of if-Match, If-Modified-Since, If-None-Match, If-Range, If-Unmodified-Since header), the server allows access to resources, but returns a status code if the request meets the conditions;
  • 307 Temporary Redirect: Temporary redirection, which has the same meaning as 303. 307 will follow the browser standard and will not change from POST to GET; (different browsers may have different situations);

4xx (4 types)

  • 400 Bad Request: Indicates that there is a syntax error in the request message;
  • 401 Unauthorized: Unauthorized, HTTP authentication is required;
  • 403 Forbidden: The server denies the access (there is a problem with access rights)
  • 404 Not Found: Indicates that the requested resource cannot be found on the server. In addition, it can also be used when the server rejects the request but does not want to give the reason for the rejection;

5xx (2 types)

  • 500 Inter Server Error: Indicates that an error occurred when the server executed the request, it may also be a bug in the web application or some temporary error;
  • 503 Server Unavailable: Indicates that the server is temporarily overloaded or is being shut down for maintenance and cannot process requests;

Guess you like

Origin blog.csdn.net/Robergean/article/details/120074543