Server response codes or, as they are also called, HTTP Status Codes (HTTP Status Codes) are transmitted in the header of the server's response to the client's request over the HTTP protocol, and contain information about how much the server was able to process the client's request.
Does it sound complicated? In fact, there is nothing complicated in this. See..
First, you need to understand what a client and server are, and, as they say, why you need them. The client-server architecture is at the heart of the Internet that we are used to. The content of sites and applications is located on servers, and to access it, client programs are used that can interact with servers (they are also programs) via various network protocols (channels), in particular, the HTTP protocol.
The article turned out to be very voluminous, so to search for information about the error you are interested in or the server response code, use the search on the page Ctrl+F
The client and server interact by exchanging messages. Messages from the client are called requests, and messages from the server are called responses. Each message must contain a header and can contain a so-called body.
When a web client (browser or search robot) requests information from the server (page, file, or other data), the server tries to execute the request and return the result to the client (after all, the client is always right ;) If the server succeeds, it reports it (in the response header)and returns it (in the response body). what the client needs. But it also happens that the server can't find the right file/page, or it's overloaded with requests, or you need authorization to access the content, or something else. He should also inform the client about all this. The client and server communicate using codes. After receiving a response from the server, the client must process it according to the status code.
These codes are standardized and used by all servers and clients that communicate using the HTTP protocol. They consist of 3 digits, the first of which indicates the class (category) of the status code. There are 5 classes:
1xx - Information-time codes used by the server to inform the client that it has accepted and is processing the request
- 100 Continue
- 101 Switching Protocols
- 102 Processing
2Ñ…Ñ… - Success (Successful execution) - passed when the request is processed successfully
- 200 OK
- 201 Created
- 202 Accepted
- 203 Non-Authoritative Information
- 204 No Content
- 206 Partial Content
3Ñ…Ñ… - Redirection (Redirect) - notifies that the client needs to perform additional actions to complete the request.
- 300 Multiple Choices
- 301 Moved Permanently
- 302 Found
- 303 See Other
- 304 Not Modified
- 307 Temporary Redirect
- 308 Permanent Redirect
4xx-Client Error - The server reports that it cannot execute the request because it contains an error.
- 400 Bad Request
- 401 Unauthorized
- 402 Payment Required
- 403 Forbidden
- 404 Not Found
- 405 Method Not Allowed
- 406 Not Acceptable
- 407 Proxy Authentication Required
- 408 Request Timeout
- 409 Conflict
- 410 Gone
- 411 Length Required
- 412 Precondition Failed
- 413 Payload Too Large
- 414 URI Too Long
- 415 Unsupported Media Type
- 416 Range Not Satisfiable
- 417 Expectation Failed
- 418 I'm a teapot
- 421 Misdirected Request
- 422 Unprocessable Entity
- 423 Locked
- 424 Failed Dependency
- 426 Upgrade Required
- 428 Precondition Required
- 429 Too Many Requests
- 431 Request Header Fields Too Large
- 451 Unavailable For Legal Reasons
5xx-Server Error - the request was accepted, but the server cannot process it
- 500 Internal Server Error
- 501 Not Implemented
- 502 Bad Gateway
- 503 Service Unavailable
- 504 Gateway Timeout
- 505 HTTP Version Not Supported
- 507 Insufficient Storage
- 508 Loop Detected
There are a lot of codes for how you behave, and you, of course, do not need to fill your head with them. But some of the most common ones are useful to know.
Let's look at the above classes with their most common codes and discuss the last two classes of codes in particular detail.