DEV Community

Cover image for Comprehensive Guide to HTTP Status Codes: Handling Data Fetching and Processing Errors
Md Nazmus Sakib
Md Nazmus Sakib

Posted on

3 2 1 2

Comprehensive Guide to HTTP Status Codes: Handling Data Fetching and Processing Errors

HTTP status codes are grouped into various categories, such as Informational (1xx), Successful (2xx), Redirection (3xx), Client Errors (4xx), and Server Errors (5xx). Below is a breakdown of status codes that are commonly encountered during data fetching or processing errors.


1xx: Informational

1xx status codes indicate that a request has been received and the process is continuing. However, these are rarely associated with errors.

Code Message Description
100 Continue The server has received the request headers, and the client can proceed to send the body.
101 Switching Protocols The server is switching protocols as requested by the client, e.g., to WebSockets.

2xx: Successful

2xx codes signify that the request was successfully received, understood, and accepted.

Code Message Description
200 OK The request was successful, and the server returned the requested data.
201 Created A new resource was successfully created as a result of the request.
204 No Content The request was successfully processed, but no content is returned.

3xx: Redirection

3xx codes indicate that the client must take additional action to complete the request, such as following a redirection.

Code Message Description
301 Moved Permanently The requested resource has been permanently moved to a new URI.
302 Found The resource is temporarily located at a different URI.
303 See Other The client should retrieve the resource using a different URI.
304 Not Modified The resource has not been modified; use the cached version.

4xx: Client Errors

4xx codes indicate that there was an error with the client's request.

Code Message Description
400 Bad Request The server could not understand the request due to malformed syntax.
401 Unauthorized The client must authenticate to access the resource.
403 Forbidden The server is refusing to process the request, even with valid credentials.
404 Not Found The requested resource could not be found on the server.
405 Method Not Allowed The request method is not supported for the requested resource.
408 Request Timeout The server timed out waiting for the client's request.
409 Conflict The request could not be processed due to a conflict in the request.
413 Payload Too Large The request payload is larger than the server is willing to process.
414 URI Too Long The request URI is too long for the server to handle.
429 Too Many Requests The client has sent too many requests in a given period.

5xx: Server Errors

5xx codes indicate that the server encountered an error while processing the request.

Code Message Description
500 Internal Server Error A generic error occurred on the server.
501 Not Implemented The server does not support the functionality required to fulfill the request.
502 Bad Gateway The server received an invalid response from an upstream server.
503 Service Unavailable The server is currently unable to handle the request due to overload or maintenance.
504 Gateway Timeout The server acting as a gateway timed out while waiting for a response.
507 Insufficient Storage The server is unable to store the representation needed to complete the request.
511 Network Authentication Required The client must authenticate to gain network access.

Summary of Relevant Codes

Here is a quick summary of key codes relevant to data fetching and processing:

Code Meaning Possible Cause
400 Bad Request Malformed request or invalid input.
401 Unauthorized Missing or invalid authentication.
403 Forbidden Access denied despite valid authentication.
404 Not Found The requested resource does not exist.
408 Request Timeout The client took too long to send a request.
500 Internal Server Error An unexpected error occurred on the server.
502 Bad Gateway Invalid response from an upstream server.
503 Service Unavailable The server is overloaded or down for maintenance.
504 Gateway Timeout Backend service timed out.
507 Insufficient Storage Not enough storage on the server.
511 Network Authentication Required Client must authenticate for network access.

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

Cloudinary image

Optimize, customize, deliver, manage and analyze your images.

Remove background in all your web images at the same time, use outpainting to expand images with matching content, remove objects via open-set object detection and fill, recolor, crop, resize... Discover these and hundreds more ways to manage your web images and videos on a scale.

Learn more

Augment Code in Action: Overview, Demo & Q&A

Imagine building software with an AI that deeply understands your codebase. Join a live demo of Augment Code to see how it helps with onboarding, testing, and refactoring that fit your stack

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️