Junior
What response codes can a web server return?
sobes.tech AI
Answer from AI
1xx: Informational
- 100 Continue: The server has received the initial part of the request and is waiting for the continuation.
- 101 Switching Protocols: The client has requested to switch protocols, and the server is willing to do so.
2xx: Successful operations
- 200 OK: Standard success response.
- 201 Created: The resource has been successfully created as a result of the request.
- 204 No Content: The server has successfully processed the request but will not send a response body.
3xx: Redirects
- 301 Moved Permanently: The resource has been permanently moved to a new URI.
- 302 Found (formerly "Moved Temporarily"): The resource is temporarily located at a different URI.
- 304 Not Modified: The resource has not been modified since the last request.
4xx: Client errors
- 400 Bad Request: The server cannot process the request due to a syntax error or invalid parameters.
- 401 Unauthorized: Authentication is required to access the resource.
- 403 Forbidden: The server understood the request but refuses to authorize it.
- 404 Not Found: The server cannot find the requested resource.
- 405 Method Not Allowed: The method used in the request is not allowed for this resource.
5xx: Server errors
- 500 Internal Server Error: Internal server error.
- 502 Bad Gateway: The server, acting as a gateway or proxy, received an invalid response from the upstream server.
- 503 Service Unavailable: The server is temporarily unable to handle the request, usually due to overload or maintenance.
- 504 Gateway Timeout: The server, acting as a gateway, did not receive a timely response from the upstream server.