DEV Community

Cover image for What are those HTTP Response Codes??
ghubrakesh
ghubrakesh

Posted on

What are those HTTP Response Codes??

Whenever we visit a website and for some reason, it gets failed to load, we get the response codes such as 'error 403 - Forbidden' or 'error 404-Content Not Found', ever wondered what those codes represent?

HTTP Response Status Codes

HTTP response status code represents whether the specific HTTP request has been successfully completed or not. Those codes are grouped under 5 categories:

  1. 1xx - Informational

  2. 2xx - Successful

  3. 3xx - Redirection

  4. 4xx - Client Error

  5. 5xx - Server Error

1. Informational (100 to 199)

These codes indicate that the request has been received and that the process is continuing.

  • 100 - Continue: This response is used to let the client know that the request has been received and has not yet been rejected by the server.

  • 103 - Processing: This is used to indicate that the server has accepted the complete request, but has not yet completed it.

2. Successful (200 to 299)

These codes indicate that the request was successful and that the requested information has been sent in the response.

  • 200 - OK: The request was successful, and the requested information has been sent in the response (the desired result).

  • 204 - No Content: The request was successful, but there is no content (data information) to send in the response.

3. Redirection (300 to 399)

These codes indicate that the client must take additional action to complete the request.

  • 301 - Moved Permanently: The requested resource has been permanently moved to a new URL. This generally happens when a website changes its URL, hence, the request cannot reach the desired servers.

  • 302 - Found: The requested resource has been temporarily moved to a new URL. The client should use the new URL in this and future requests.

4. Client Error (400 to 499)

These codes indicate that there was an error with the request made from the client side.

  • 400 - Bad Request: The request was either invalid or cannot be fulfilled for the instance.

  • 401 - Unauthorized: The client must authenticate itself to get the requested response.

  • 402 - Payment Required: This code is reserved for future use.

  • 403 - Forbidden: The client does not have permission to access the requested resource.

  • 404 - Not Found: The requested resource could not be found on the server.

  • 405 - (Method Not Allowed): Requested HTTP method is not permitted for the specific resource.

  • 409 - (Conflict): There is a conflict with the current state of the resource. It is often related to issues like resource locking or simultaneous updates by multiple clients.

5. Server Error (500 to 599)

These codes indicate that there was an error with the server while processing the request.

  • 500 - Internal Server Error: An unexpected condition was encountered by the server and no specific message is suitable.

  • 503 - Service Unavailable: The server is currently unable to handle the request due to a temporary overload or maintenance.

Conclusion:

HTTP response codes are an important part of the HTTP protocol, as they provide a way for servers to communicate information about the status of a request to clients. Understanding these codes can help us troubleshoot issues with your website or application.

Top comments (3)

Collapse
 
sreno77 profile image
Scott Reno

Very useful

Collapse
 
webjose profile image
José Pablo Ramírez Vargas

405 is METHOD NOT ALLOWED; 409 is CONFLICT.

Collapse
 
ghubrakesh profile image
ghubrakesh • Edited

Thank You, I have updated it.