Get started with 33% off your first certification using code: 33OFFNEW

All of the HTTP status codes explained

3 min read
Published on 2nd February 2024

In the world of web development, understanding HTTP status codes is essential for diagnosing issues, improving user experience, and ensuring effective communication between clients and servers. These codes, part of the HTTP response from the server, indicate the status of a requested action. Let's delve into each category and specific codes to grasp their full spectrum.

1xx: Informational Responses

This category of HTTP status codes indicates provisional responses, primarily acknowledging the receipt of a request.

  • 100 Continue: The server has received the request headers and the client should proceed with sending the request body.
  • 101 Switching Protocols: The requester has asked the server to switch protocols and the server has agreed.
  • 102 Processing (WebDAV): The server has received and is processing the request but no response is available yet.

2xx: Success

These codes signify that the client's request was successfully received, understood, and accepted.

  • 200 OK: The standard response for successful HTTP requests.
  • 201 Created: The request has been fulfilled and resulted in a new resource being created.
  • 202 Accepted: The request has been accepted for processing, but the processing has not been completed.
  • 203 Non-Authoritative Information: The server is a transforming proxy that received a 200 OK from its origin, but is returning a modified version.
  • 204 No Content: The server successfully processed the request, but is not returning any content.
  • 205 Reset Content: The server successfully processed the request, but is not returning any content and requires the requester to reset the document view.
  • 206 Partial Content: The server is delivering only part of the resource due to a range header sent by the client.

3xx: Redirection

This category indicates further action needs to be taken by the user agent to fulfill the request.

  • 300 Multiple Choices: Indicates multiple options for the resource that the client may follow.
  • 301 Moved Permanently: This and all future requests should be directed to the given URI.
  • 302 Found: Tells the client to look at (browse to) another URL.
  • 303 See Other: The response to the request can be found under another URI using a GET method.
  • 304 Not Modified: Indicates that the resource has not been modified since the last request.
  • 307 Temporary Redirect: The request should be repeated with another URI, but future requests should still use the original URI.
  • 308 Permanent Redirect (RFC 7538): The request, and all future requests should be repeated using another URI.

4xx: Client Errors

These status codes indicate that the client seems to have erred.

  • 400 Bad Request: The server cannot or will not process the request due to an apparent client error.
  • 401 Unauthorized: Authentication is required and has failed or has not yet been provided.
  • 403 Forbidden: The request was valid, but the server is refusing action.
  • 404 Not Found: The requested resource could not be found.
  • 405 Method Not Allowed: A request was made with a method not supported on the resource.
  • 406 Not Acceptable: The requested resource is only capable of generating content not acceptable according to the Accept headers sent in the request.
  • 408 Request Timeout: The server timed out waiting for the request.
  • 409 Conflict: The request could not be processed because of conflict in the request.
  • 418 I'm a teapot: Yeah, you read that one right.

5xx: Server Errors

These codes indicate that the server failed to fulfill a valid request.

  • 500 Internal Server Error: A generic error message when an unexpected condition was encountered.
  • 501 Not Implemented: The server either does not recognize the request method or lacks the ability to fulfill it.
  • 502 Bad Gateway: The server was acting as a gateway or proxy and received an invalid response from the upstream server.
  • 503 Service Unavailable: The server is currently unavailable (overloaded or down for maintenance).
  • 504 Gateway Timeout: The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.
  • 505 HTTP Version Not Supported: The server does not support the HTTP protocol version used in the request.

Overview

HTTP status codes are a critical component of web communication, providing insights into the nature of each HTTP interaction. Understanding these codes is key for developers and IT professionals to effectively build, troubleshoot, and maintain web applications and services.