You get a bonus - 1 coin for daily activity. Now you have 1 coin

HTTP response codes

Lecture



Knowledge of HTTP return codes (responses) is very important for the system administrator.

You probably already know that the HTTP protocol returns certain HTTP response codes, which are HTTP connection status codes.

Surely, the code 404 - Not Found is familiar to everyone, because all Internet users without exception face it. Error 404 is the most common because some links of web resources point to missing pages. Sometimes all errors from the 400 ... 415 range are regarded as a 404 error.

The HTTP 200 response code is a normal completion code for the operation; you cannot see it when you get the page.

A total of 5 categories of HTTP response codes are defined. Each of these categories may contain 100 return codes.

Range codes 100 ... 199 are informational. With their help, various information related to the request is returned.

The range 200 ... 299 is the range of successful operations. Codes belonging to this range, report on the successful completion of an operation. Codes reporting that the requested file is empty (no content) and reporting that the request has been accepted also belong to this range.

The range of response codes 300 ... 399 are redirect codes.

Range codes 400 ... 499 are customer errors. For example, a user may request a non-existent document. The "Forbidden" and "Unauthorized" errors also belong to this range. Both the first and second report that the client does not have access to a specific resource. In the first case, access is simply denied, and in the second case, the client is not authorized.

Response codes 500 ... 599 are server error codes. These errors occur when an internal server error or if it is not configured correctly. In the second case, the server simply cannot correctly return the response to the request. This type of error occurs normally when an error is made by a script (script) located on the server.

Some script interpreters, such as PHP, never make such an error. If there are errors in the PHP script, the PHP interpreter will simply return the error message to the client. From the server side, this will look like a normal response to the client (browser). For example, unlike the PHP interpreter, Perl returns an error message to the HTTP protocol.

Now we list the main HTTP return codes:

HTTP return code table

Return code
HTTP Return Code Description
100
Continue (Continue)
101
Switching protocols (switching protocols)
200
Ok
201
Created
202
Accepted
203
Non-authoritative information (non-authoritative information)
204
File is empty (no content)
205
Reset content
206
Partial content
300
Multiple choice (multiple choices)
301
Moved permanently
302
Moved temporarily (moved temporarily)
303
See other
304
Not modified
305
Use proxy server (use proxy)
400
Bad request
401
Unauthorized
402
Payment Required
403
No access (forbidden)
404
Not found
405
Method not allowed
406
Not acceptable
407
Proxy authentication required (proxy authentication required)
408
Request time-out
411
Length length (when using the POST method)
412
Previous condition failed (precondition failed)
413
Request entity too large
414
Requested URL is too large (request URL too large)
415
Unsupported media type
500
Server error (server error)
501
Not implemented
502
Bad Gateway
503
Lack of resources
504
Gateway timeout exceeded
505
Unsupported HTTP version (HTTP version not supported)

Of course, this is not a complete list of HTTP response codes, but the above list of basic return codes is enough.

created: 2016-01-25
updated: 2021-03-13
197



Rating 9 of 10. count vote: 2
Are you satisfied?:



Comments


To leave a comment
If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Running server side scripts using PHP as an example (LAMP)

Terms: Running server side scripts using PHP as an example (LAMP)