Skip to content
Home » HTTP Response Status Codes: Client Error (400 – 499)

HTTP Response Status Codes: Client Error (400 – 499)

http-code-4xx

HTTP response status codes are crucial in web development, providing valuable insights into the outcome of a client’s request.

In our previous blog posts, we explored Informational Responses (100 – 199), Successful Responses (200 – 299), and Redirection Responses (300 – 399), learning how they establish communication, indicate success, and handle redirects.

Now, let’s dive into the fourth class of HTTP response status codes – Client Error Responses (400 – 499). These codes signify that the client’s request contains errors or cannot be fulfilled. Join us as we explore each of these client error responses in detail.

Table: HTTP Response Status Codes – Client Error Responses

Status CodeNameDescriptionExample
400Bad RequestThe server cannot understand the request due to bad syntax or other client-side errors.HTTP/1.1 400 Bad Request
401UnauthorizedThe request requires user authentication. The client must provide valid credentials.HTTP/1.1 401 Unauthorized
402Payment RequiredReserved for future use.HTTP/1.1 402 Payment Required
403ForbiddenThe server understands the request, but refuses to authorize it. The client should not repeat the request without modifications.HTTP/1.1 403 Forbidden
404Not FoundThe requested resource could not be found on the server. It may have been moved or deleted.HTTP/1.1 404 Not Found
405Method Not AllowedThe request method (GET, POST, PUT, DELETE, etc.) is not allowed for the requested resource.HTTP/1.1 405 Method Not Allowed
406Not AcceptableThe requested resource cannot produce a response that is acceptable according to the headers sent in the request.HTTP/1.1 406 Not Acceptable
407Proxy Authentication RequiredThe client must first authenticate itself with the proxy before making the request to the server.HTTP/1.1 407 Proxy Authentication Required
408Request TimeoutThe client took too long to complete the request.HTTP/1.1 408 Request Timeout
409ConflictThe request could not be completed due to a conflict with the current state of the target resource.HTTP/1.1 409 Conflict
410GoneThe requested resource is no longer available at the server and has been permanently removed.HTTP/1.1 410 Gone
411Length RequiredThe server requires a valid Content-Length header to be included in the request.HTTP/1.1 411 Length Required
412Precondition FailedThe server does not meet one of the preconditions specified by the client in the request headers.HTTP/1.1 412 Precondition Failed
413Payload Too LargeThe server refuses to process the request because the request payload is too large.HTTP/1.1 413 Payload Too Large
414URI Too LongThe server refuses to process the request because the URI (Uniform Resource Identifier) provided is too long.HTTP/1.1 414 URI Too Long
415Unsupported Media TypeThe server refuses to process the request because the media type of the request data is not supported.HTTP/1.1 415 Unsupported Media Type
416Range Not SatisfiableThe server cannot satisfy the request range specified in the Range header.HTTP/1.1 416 Range Not Satisfiable
417Expectation FailedThe server cannot meet the requirements of the Expect request-header field.HTTP/1.1 417 Expectation Failed
418I’m a teapotA fun and humorous status code, not to be taken seriously. This code indicates that the server is a teapot, not designed to brew coffee.HTTP/1.1 418 I’m a teapot
421Misdirected RequestThe request was directed at a server that is not able to produce a response.HTTP/1.1 421 Misdirected Request
422Unprocessable EntityThe server understands the request, but the request data is semantically incorrect or unable to be processed.HTTP/1.1 422 Unprocessable Entity
423LockedThe requested resource is locked and cannot be accessed.HTTP/1.1 423 Locked
424Failed DependencyThe request failed due to a failure of a previous request.HTTP/1.1 424 Failed Dependency
425Too EarlyThe server refuses to process the request because it is too early in its processing flow.HTTP/1.1 425 Too Early
426Upgrade RequiredThe server refuses to perform the request using the current protocol but may be willing to do so if the client upgrades to a different protocol.HTTP/1.1 426 Upgrade Required
428Precondition RequiredThe server requires the request to be conditional.HTTP/1.1 428 Precondition Required
429Too Many RequestsThe user has sent too many requests in a given amount of time.HTTP/1.1 429 Too Many Requests
431Request Header Fields Too LargeThe server refuses to process the request because the request headers are too large.HTTP/1.1 431 Request Header Fields Too Large
451Unavailable For Legal ReasonsThe server refuses to provide the requested resource due to legal reasons.HTTP/1.1 451 Unavailable For Legal Reasons

Client error responses (status codes 400 – 499) indicate that the client’s request contains errors or is not valid for some reason. These codes are essential for identifying and diagnosing issues with client-side requests. When handling these responses, developers should provide clear error messages and guide users towards resolving the issues.

Next, we’ll explore Server Error Responses (500 – 599), which indicate that the server failed to fulfill a valid request. Happy coding!


Visit Techtalkbook to find more related topics.


References

https://developer.mozilla.org/en-US/docs/Web/HTTP/Status

Leave a Reply

Your email address will not be published. Required fields are marked *

1 Shares
Tweet
Pin1
Share
Share
Share