What Are HTTP Status Codes?
HTTP status codes are three-digit numbers returned by a web server in response to a client's request. They indicate whether the request was successful, redirected, resulted in a client error, or caused a server error. Every web developer, API designer, and DevOps engineer needs to understand these codes to build reliable applications and debug issues effectively.
Status codes are grouped into five categories based on the first digit. Each category represents a general class of response, making it easy to understand the nature of the response at a glance even before reading the specific code.
1xx — Informational Responses
The 1xx class of status codes indicates that the server has received the request and the client should continue. These are rarely encountered directly in application code, but they play an important role in HTTP protocol mechanics.
100 Continue
— The server received the request headers and the client
should proceed to send the request body.
101 Switching Protocols
— The server is switching protocols as requested by the
client (e.g., upgrading from HTTP to WebSocket).
103 Early Hints
— Used to return response headers before the final
response, allowing the browser to preload resources.2xx — Success
The 2xx class indicates that the request was successfully received, understood, and accepted. These are the status codes you want to see in your application logs.
200 OK
— The request succeeded. The response body contains the
requested resource. Most common success code.
201 Created
— A new resource was successfully created. Typically
returned after a POST request.
204 No Content
— The request succeeded but there is no response body.
Common for DELETE requests.
206 Partial Content
— The server is returning only part of the resource,
as requested by a Range header.3xx — Redirection
The 3xx class indicates that the client must take additional action to complete the request, usually by following a redirect to a different URL. Understanding the difference between redirect types is important for SEO and caching.
301 Moved Permanently
— The resource has been permanently moved to a new URL.
Search engines update their index.
302 Found
— The resource is temporarily at a different URL.
The original URL should still be used in the future.
304 Not Modified
— The resource has not changed since the last request.
The client can use its cached version.
307 Temporary Redirect
— Like 302, but the HTTP method must not change.
A POST request must remain a POST.
308 Permanent Redirect
— Like 301, but the HTTP method must not change.4xx — Client Errors
The 4xx class indicates that the client sent a request that the server cannot or will not process. These are the most common error codes developers encounter during API development.
400 Bad Request
— The request is malformed. Check your JSON syntax,
required fields, and data types.
401 Unauthorized
— Authentication is required. Send a valid token
or API key in the Authorization header.
403 Forbidden
— The server understood the request but refuses to
authorize it. The user lacks permission.
404 Not Found
— The requested resource does not exist. Check the
URL path and resource ID.
405 Method Not Allowed
— The HTTP method is not supported for this endpoint.
For example, sending DELETE to a read-only resource.
409 Conflict
— The request conflicts with the current state of
the resource (e.g., duplicate entry).
422 Unprocessable Entity
— The request is well-formed but contains validation
errors (e.g., invalid email format).
429 Too Many Requests
— Rate limit exceeded. Wait and retry after the
time specified in the Retry-After header.5xx — Server Errors
The 5xx class indicates that the server encountered an error while processing a valid request. These errors are not the client's fault and usually indicate a bug, infrastructure issue, or overloaded server.
500 Internal Server Error
— A generic error. The server encountered an unexpected
condition. Check server logs for details.
502 Bad Gateway
— The server, acting as a gateway, received an invalid
response from an upstream server.
503 Service Unavailable
— The server is temporarily unable to handle the
request, usually due to maintenance or overload.
504 Gateway Timeout
— The server, acting as a gateway, did not receive a
timely response from an upstream server.Debugging Tips
When you encounter an unexpected status code, start by reading the response body. Most well-designed APIs include an error message that explains what went wrong. For 400 errors, check that your request body matches the expected schema. For 401 and 403 errors, verify your authentication credentials and permissions. For 500 errors, check the server logs or contact the API provider.
Use PulpMiner's HTTP Status Codes tool as a quick reference during development. It provides detailed descriptions, common causes, and suggested fixes for every standard HTTP status code. Bookmark it as a handy reference for your daily development workflow.
