Daily Blog - Chat Http Status Code

Article directory

Insert image description here


Overview

HTTP's response code is a three-digit code used to indicate the server's processing result of the client's request. The codes are divided into five categories, representing different situations and outcomes. Here are the main categories of HTTP response codes and some common examples:

  1. Informational (Informational, 100-199):

    • 100 Continue: The server has received part of the request and the client should continue sending the rest.
    • 101 Switching Protocols: The server has understood the client's request, but requires switching protocols (for example, from HTTP to WebSocket).
  2. Success (200-299):

    • 200 OK: The request was successful and the server returned the requested resource.
    • 201 Created: The request was successful and the server created a new resource.
    • 204 No Content: The request was successful, but no content was returned in the response.
  3. Redirection (Redirection, 300-399):

    • 301 Moved Permanently: The requested resource has been permanently moved to a new URL.
    • 302 Found: The requested resource was temporarily moved to a different URL.
    • 304 Not Modified: The resource requested by the client has not changed and a cached copy can be used.
  4. Client Error (400-499):

    • 400 Bad Request: The request has syntax errors or cannot be understood.
    • 401 Unauthorized: Authentication required, client did not provide valid credentials.
    • 403 Forbidden: The server rejected the request and the client does not have permission to access the resource.
    • 404 Not Found: The requested resource does not exist.
  5. Server Error (500-599):

    • 500 Internal Server Error: The server encountered an unpredictable error.
    • 503 Service Unavailable: The server is currently unable to handle the request, usually due to overload or maintenance.
    • 504 Gateway Timeout: The server timed out while waiting for a response from another server.

These are some common examples of HTTP response codes. Each code conveys different information to help clients and developers understand how the request was processed. Depending on the response code, the client can take different actions to handle the response.

Illustration

Insert image description here
HTTP response codes are divided into five categories:

  • Informative (100-199)
  • Success (200-299)
  • Redirect (300-399)
  • Client errors (400-499)
  • Server error (500-599)

These codes are defined in RFC 9110. To save you time reading the entire document (which is about 200 pages), here is a summary of some of the most common codes.

Insert image description here

Guess you like

Origin blog.csdn.net/yangshangwei/article/details/132838895