1. What is HTTP status code? 2. What are the possible values of HTTP status code and what does the value mean?
HTTP status codes are three-digit numbers that indicate the outcome of an HTTP request or API call. They provide information about whether a request was successful, encountered an error, or requires further action.
-
1xx (Informational Responses):
-
100 Continue: The initial part of the request has been received, and the client should continue.
-
101 Switching Protocols: The server will switch protocols as requested by the client.
-
102 Processing: The server has received and is processing the request, but no response is available yet.
-
-
2xx (Successful Responses):
-
200 OK: The request was successful.
-
201 Created: The request was successful, and a resource was created.
-
202 Accepted: The request was accepted but not yet processed.
-
203 Non-Authoritative Information: The request was successful, but the returned information may be from another source.
-
204 No Content: The request was successful, but there's no representation to return.
-
205 Reset Content: Tells the user-agent to reset the document which sent the request.
-
206 Partial Content: The request will return partial data (used in large downloads).
-
-
3xx (Redirection Messages):
-
300 Multiple Choices: Multiple options for the resource can be returned.
-
301 Moved Permanently: The resource has moved permanently to a new URL.
-
302 Found: The resource has moved temporarily to a new URL.
-
303 See Other: The response can be found under a different URL.
-
304 Not Modified: An efficient way to update cached data; the data hasn't changed.
-
307 Temporary Redirect: The resource has been temporarily moved to a new URL.
-
308 Permanent Redirect: The resource has been permanently moved to a new URL.
-
-
4xx (Client Error Responses):
-
400 Bad Request: The server couldn't understand the request due to invalid syntax.
-
401 Unauthorized: The client must authenticate itself to get the requested response.
-
402 Payment Required: Reserved for future use; not used currently.
-
403 Forbidden: The client doesn't have rights to the content.
-
404 Not Found: The server can't find the requested resource.
-
405 Method Not Allowed: The request method is not supported for the resource.
-
406 Not Acceptable: The server can't produce a response matching the list of acceptable values defined in the request's headers.
-
407 Proxy Authentication Required: The client must authenticate itself with the proxy.
-
408 Request Timeout: The server didn't get a complete request message in time.
-
409 Conflict: The request could not be completed due to a conflict.
-
410 Gone: The requested content has been permanently deleted.
-
411 Length Required: The server won't accept the request without a valid Content-Length header field.
-
412 Precondition Failed: One or more conditions given in the request header fields evaluated to false.
-
413 Payload Too Large: The request entity is larger than limits defined by the server.
-
414 URI Too Long: The URI requested by the client is longer than the server can interpret.
-
415 Unsupported Media Type: The format of the request entity is not supported by the server.
-
416 Range Not Satisfiable: The range specified in the Range header field of the request can't be satisfied.
-
417 Expectation Failed: The expectation given in the Expect header field can't be met.
-
418 I'm a teapot: An April Fools' joke; not implemented by actual HTTP servers.
-
429 Too Many Requests: The client has sent too many requests in a given amount of time.
-
-
5xx (Server Error Responses):
-
500 Internal Server Error: The server has encountered a situation it doesn't know how to handle.
-
501 Not Implemented: The request method is not supported by the server and can't be handled.
-
502 Bad Gateway: The server, while working as a gateway, got an invalid response.
-
503 Service Unavailable: The server is not ready to handle the request.
-
504 Gateway Timeout: The server, while working as a gateway, did not receive a timely response.
-
505 HTTP Version Not Supported: The server doesn't support the HTTP protocol version.
-