Junior — Middle
Can you list the main HTTP status codes and their purposes?
sobes.tech AI
Answer from AI
Main HTTP status codes and their purposes:
- 1xx (Informational): Indicate that the request has been received and is being processed.
- 2xx (Success): The request was successfully processed.
- 200 OK — The request was successful.
- 201 Created — The resource was successfully created.
- 3xx (Redirection): The client must take additional actions to complete the request.
- 301 Moved Permanently — The resource has been permanently moved.
- 302 Found — Temporary redirect.
- 4xx (Client errors): Errors on the client side.
- 400 Bad Request — Invalid request.
- 401 Unauthorized — Authentication is required.
- 403 Forbidden — Access is denied.
- 404 Not Found — The resource was not found.
- 5xx (Server errors): Errors on the server side.
- 500 Internal Server Error — Internal server error.
- 503 Service Unavailable — Service is unavailable.
Knowing these codes helps to correctly handle server responses in applications.