Junior — Middle
Can you name the main status codes used in the HTTP protocol to indicate the results of a request?
sobes.tech AI
Answer from AI
The main HTTP status codes are divided into five classes:
- 1xx (Informational): The request has been received, and the process is continuing (e.g., 100 Continue).
- 2xx (Success): The request was successfully received, understood, and accepted (e.g., 200 OK, 201 Created).
- 3xx (Redirection): Further action is needed to complete the request (e.g., 301 Moved Permanently, 302 Found).
- 4xx (Client Error): There was an error on the client side (e.g., 400 Bad Request, 401 Unauthorized, 404 Not Found).
- 5xx (Server Error): There was an error on the server side (e.g., 500 Internal Server Error, 503 Service Unavailable).
In C#, the HttpStatusCode enumeration from the System.Net namespace is often used to work with HTTP statuses.