Demystifying HTTP Response Status Codes

Mamta Yadav
2 min readMar 9, 2024

--

When you interact with websites or web applications, the server communicates its responses using HTTP status codes. These codes provide essential information about the outcome of a request and help developers diagnose and resolve issues. Let’s delve into the most common HTTP status codes and their meanings.

1xx Informational Responses

  1. 100 Continue: The server has received the initial part of the request and hasn’t rejected it yet.
  2. 101 Switching Protocols: The server is changing protocols, such as switching from HTTP to WebSocket.

2xx Success Responses

  1. 200 OK: The request was successful, and the server has returned the requested resource.
  2. 201 Created: The request has been fulfilled, and a new resource has been created as a result.
  3. 202 Accepted: The request has been accepted for processing, but the processing has not been completed.
  4. 204 No Content: The server successfully processed the request but isn’t returning any content.

3xx Redirection Messages

  1. 300 Multiple Choices: Indicates multiple options for the requested resource.
  2. 301 Moved Permanently: The requested resource has been permanently moved to a new URL.
  3. 302 Found: The requested resource has been temporarily moved to a different URL.
  4. 304 Not Modified: Indicates that the resource has not been modified since the last request.

4xx Client Error Responses

  1. 400 Bad Request: The server cannot process the request due to a client error, such as malformed syntax.
  2. 401 Unauthorized: The request requires user authentication.
  3. 403 Forbidden: The client does not have permission to access the requested resource.
  4. 404 Not Found: The requested resource could not be found on the server.

5xx Server Error Responses

  1. 500 Internal Server Error: A generic error message indicating that something has gone wrong on the server.
  2. 501 Not Implemented: The server does not support the functionality required to fulfill the request.
  3. 502 Bad Gateway: The server received an invalid response from an upstream server.
  4. 503 Service Unavailable: The server is temporarily unable to handle the request due to maintenance or overload.
  5. 504 Gateway Timeout: The server did not receive a timely response from an upstream server.
  6. 505 HTTP Version Not Supported: The server does not support the HTTP protocol version used in the request.

Additional Status Codes (Uncommon)

  1. 451 Unavailable For Legal Reasons: The server is denying access to the resource as per legal demands.
  2. 418 I’m a teapot: A humorous code indicating that the server refuses to brew coffee because it is, in fact, a teapot.

Conclusion

Understanding HTTP response status codes is essential for both developers and users. They provide valuable insights into the outcome of a request and help diagnose and troubleshoot issues effectively. By familiarizing yourself with these status codes, you can better navigate the intricacies of web development and ensure smoother user experiences.

--

--

Mamta Yadav
Mamta Yadav

Written by Mamta Yadav

Information geek, TecH enthusiasm. ||||| Storyteller from my preliterate days. I write them down✍️

No responses yet