I’m hungry — eats heading HTTP.
So know the principle of operation heading HTTP
List of HTTP status codes
The simple topic will discuss him quickly. ;)
HTTP response codes — server response status to the client by numbering.
Very known response codes that do not need to be discussed:
It is worth knowing that the response codes are divided:
- 1xx informational codes
- 2xx Success codes
- 3xx Redirection codes
- 4xx Client Error codes
- 5xx Server Error codes
The status codes can also be divided:
1. Used in websites “Standard”
- 200 — OK
- 404 — Not Found
- 500 — Internal Server Error
- 302 — Found
- 301 — Moved permanently
- 400 — Bad request
2. For REST API:
- 201 — Created
- 202 — Accepted
- 401 — Unauthorized
- 403 — Forbidden
- 429 — Too many Requests
The principle of operation of specific HTTP response codes:
- 201 — Created — Create a resource on the server.
The status is only used in the REST API in the POST method. Status 201 specifies the place where the resource was created in the HTTP header “Location”.
2. 302 — Found — The specified resource has been moved to a different address.
3. 403 — Forbidden — Lack of entitlements to resources. Results of file permissions.
4. 301 — Moved permanently — Redirecting to a specific page.
5. 400 — Bad Request — Bad client query, which means that the server can not handle our request.
6. 401 — Unauthorized — Lack of entitlements to the resource. Requires resource authorization to have access.
7. 429 — Too Many Request — The server has a limited resource request limit.
Is it worth knowing the HTTP status?
Yes, it affects SEO, e.g., statuses 301 or 302, increases the rating of the website. REST API is more readable and intuitive. We will also find it a sooner error of our web application.