Skip to content

Instantly share code, notes, and snippets.

@singhayushh
Last active July 21, 2020 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save singhayushh/a4b3d23063958c625f8a04d57b82fd88 to your computer and use it in GitHub Desktop.
Save singhayushh/a4b3d23063958c625f8a04d57b82fd88 to your computer and use it in GitHub Desktop.
About some of the most used HTTP Status Codes

The 200 Family - Everything's Good

  1. 200 - denotes Successful Operation, used mainly in response of a get request.
  2. 201 - denotes Seccessful Creation, mostly used in response of a post request for creation of some resource on the server.
  3. 206 - denotes Partial Content, mostly used when partial chunk of data is requested through the server.

The 400 Family - Error on client side

  1. 400 - Bad Request, occurs when the server cannot understand the request sent.
  2. 401 - Unauthorized, occurs when the authorization for accessing some content is incorrect
  3. 403 - Forbidden, occurs when inaccessible resource is tried to be accessed in the request.
  4. 404 - Not Found, occurs when the request tries to access some non existent resource.
  5. 405 - Not Allowed, occurs when a banned request is passed (say the GET request for /api route, which was banned by server)

The 500 Family - Error on server side

  1. 500 - Internal Server Error, buggy code on the server!
  2. 501 - Not implemented, when the server method requested is no longer supported.
  3. 502 - Bad Gateway, when the error is from a resource the server uses and not directly from the server code base.
  4. 503 - Server Unavailable, occurs when the server is down for heavy load or for maintenance
  5. 504 - (Gateway) Timeout, when the server has waited for a long time for response from a resource without getting any response.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment