Junior — Middle
Can you list the main HTTP status codes and their purposes?
sobes.tech AI
Answer from AI
Main HTTP status codes are divided into several groups:
- 1xx (Informational): For example, 100 Continue — the server has received the initial part of the request and is waiting for the rest.
- 2xx (Successful):
- 200 OK — the request was successfully processed.
- 201 Created — the resource was successfully created.
- 3xx (Redirection):
- 301 Moved Permanently — the resource has been permanently moved.
- 302 Found — temporary redirection.
- 4xx (Client errors):
- 400 Bad Request — invalid request.
- 401 Unauthorized — authentication is required.
- 403 Forbidden — access is denied.
- 404 Not Found — resource not found.
- 5xx (Server errors):
- 500 Internal Server Error — internal server error.
- 503 Service Unavailable — service is temporarily unavailable.
These codes help the client understand the result of the request and take appropriate actions.