DEV Community

Cover image for HTTP status codes
merufrancis
merufrancis

Posted on

HTTP status codes

Hello everyone, am Francis a full-stack developer and a technical writer. In today's article I will be writing about http status codes; _these are codes issued to a client by a server after the client sends a request to the server.
_

The http status codes are divided into five categories:

  1. Informational responses(100-199)
  2. Successful responses(200-299)
  3. Redirection messages(300-399)
  4. Client error responses(400-499)
  5. Server error responses(500-599)

In this article, I will get into details on some of the most used status codes.

  1. 200(Ok)
    This HTTP status code is the standard code for successful HTTP requests to the server from the client. the server responds with OK to indicate to the client that the request was successful.

  2. 201(Created)
    This HTTP status code is sent from the server to the client to indicate that a new resource has been created after a successful request. This status code is often returned when a new directory or file has been uploaded to a web server.

  3. 202(Accepted)
    The Accepted status code is used when the client does not need to wait for the processing time to finish before continuing. It means that the request sent by the client has been accepted but the processing of the request has not been completed.

  4. 204(No content)
    No content status code is often used when a request to update an existing resource is made. The server indicates that the request has been processed and there is no content to return.

  5. 301(Moved permanently)
    This HTTP status code is usually the result of a change in URL or website redesign, it is returned from the server to the client to indicate that the resource trying to be accessed has been moved permanently.

  6. 302(Found)
    The HTTP 302 status code is similar to code 301, but unlike 301, 302 status code indicates that the redirect is temporary not permanent.

  7. 304(Not Modified)
    This HTTP status code improves performance, as the client does not need to download the resource again. It indicates that the requested resource has not been modified and so it can be reused.

  8. 400(Bad request)
    Bad request status code is mostly caused by a client error such a malformed URL. It means that the request could not be understood by the server due to invalid syntax.

  9. 401(Unauthorized)
    As the term suggests this HTTP status code indicates that the client is not authorized to access the requested resource from the server, mostly due to missing or invalid authorization header.

  10. 403(Forbidden)
    Due to lack of permissions, the server returns this HTTP status code to indicate that the client is not permitted to the access the requested resource.

  11. 404(Not found)
    Errors such as a typo in the URL or the page being deleted or moved, causes this HTTP status code which is an error message that means that the page the client is looking for could not be found on the server.

  12. 405(Method not allowed)
    This HTTP status code is mostly due to a problem in the server configuration, it indicates that the request method from the client for the requested resource is not allowed.

CONCLUSION
The above HTTP status code are some of the most returned responses from the server to the client after a request. Keep in touch for more technical articles coming on the way.

Top comments (0)