Forem

Vipul Kumar
Vipul Kumar

Posted on โ€ข Originally published at knowledge-bytes.com

1

Understanding HTTP Status Codes

๐Ÿ”ข Definition โ€” HTTP status codes are three-digit numbers issued by a server in response to a client's request, indicating the result of the request.

๐Ÿ“Š Categories โ€” These codes are divided into five classes: informational responses (1xx), successful responses (2xx), redirection messages (3xx), client error responses (4xx), and server error responses (5xx).

โœ… Successful Codes โ€” Codes in the 2xx range indicate successful requests, such as 200 OK, which means the request was successful and the server returned the requested resource.

๐Ÿšซ Client Errors โ€” Codes in the 4xx range indicate client errors, such as 404 Not Found, which means the server could not find the requested resource.

โš ๏ธ Server Errors โ€” Codes in the 5xx range indicate server errors, such as 500 Internal Server Error, which means the server encountered an unexpected condition that prevented it from fulfilling the request.

Informational Responses

โ„น๏ธ 100 Continue โ€” This code indicates that the initial part of a request has been received and the client should continue with the request.

๐Ÿ”„ 101 Switching Protocols โ€” Sent in response to an Upgrade request header from the client, indicating the server is switching protocols.

โณ 102 Processing โ€” Used in WebDAV to indicate that the server has received and is processing the request, but no response is available yet.

๐Ÿ”— 103 Early Hints โ€” Allows the client to start preloading resources while the server prepares a response.

Successful Responses

โœ… 200 OK โ€” The request was successful, and the server returned the requested resource.

๐Ÿ†• 201 Created โ€” Indicates that a new resource has been created as a result of the request.

๐Ÿ•’ 202 Accepted โ€” The request has been accepted for processing, but the processing is not complete.

๐Ÿ“„ 203 Non-Authoritative Information โ€” The server is returning information from a third-party source.

๐Ÿšซ 204 No Content โ€” The server successfully processed the request, but is not returning any content.

Client and Server Errors

โŒ 400 Bad Request โ€” The server could not understand the request due to invalid syntax.

๐Ÿ”’ 401 Unauthorized โ€” Authentication is required and has failed or has not yet been provided.

๐Ÿšซ 403 Forbidden โ€” The server understood the request, but refuses to authorize it.

๐Ÿ” 404 Not Found โ€” The server cannot find the requested resource.

โš ๏ธ 500 Internal Server Error โ€” The server encountered an unexpected condition that prevented it from fulfilling the request.

๐Ÿ”ง 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 not ready to handle the request, often due to maintenance or overload.

Understanding HTTP 5xx Status Codes

๐Ÿ”„ 500 Internal Server Error โ€” This code indicates a generic error message when the server encounters an unexpected condition that prevents it from fulfilling the request.

๐Ÿšซ 501 Not Implemented โ€” This status code means the server does not support the functionality required to fulfill the request, often indicating that the server does not recognize the request method.

๐Ÿ”— 502 Bad Gateway โ€” This error occurs when a server acting as a gateway or proxy receives an invalid response from the upstream server it accessed in attempting to fulfill the request.

โ›” 503 Service Unavailable โ€” This code indicates that the server is currently unable to handle the request due to temporary overloading or maintenance of the server.

โณ 504 Gateway Timeout โ€” This status code is returned when a server acting as a gateway or proxy does not receive a timely response from the upstream server.

๐Ÿ“‰ 505 HTTP Version Not Supported โ€” This error indicates that the server does not support the HTTP protocol version that was used in the request.

๐Ÿ”„ 506 Variant Also Negotiates โ€” This status code indicates an internal server configuration error where the chosen variant is itself configured to engage in content negotiation.

๐Ÿ“ฆ 507 Insufficient Storage โ€” This code is used when the server is unable to store the representation needed to complete the request.

๐Ÿ” 508 Loop Detected โ€” This status code indicates that the server terminated an operation because it encountered an infinite loop while processing a request with "Depth: infinity".

๐Ÿ”’ 511 Network Authentication Required โ€” This code is used when the client needs to authenticate to gain network access.

Read On LinkedIn or WhatsApp

Follow me on: LinkedIn | WhatsApp | Medium | Dev.to | Github

Image of Timescale

๐Ÿš€ pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applicationsโ€”without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more โ†’

Top comments (0)

Billboard image

Try REST API Generation for Snowflake

DevOps for Private APIs. Automate the building, securing, and documenting of internal/private REST APIs with built-in enterprise security on bare-metal, VMs, or containers.

  • Auto-generated live APIs mapped from Snowflake database schema
  • Interactive Swagger API documentation
  • Scripting engine to customize your API
  • Built-in role-based access control

Learn more

๐Ÿ‘‹ Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay