DEV Community

deffrin joseph
deffrin joseph

Posted on

1

There are other http status codes too..!

When my father sees a 404 page on my computer he knows that it is some kind of an error. He usually sees that on his smartphone sometimes when the internet goes off or something else. Even my father doesn't know it is a HTTP status code for Page not found, he knows that 404 is related to that kind of problem someway.

Yes, http status codes are meant to give us detail about the status of http requests.

I came to know more about the usability of this when I started doing API development. The Http status code I was more familiar with are 404, 500, 301, 200 , 403 , etc. I never thought there are lots of other status codes too. But when I started seeing a status code '202 Accepted' in an API response I came to think more about the purpose of it for client-server communication. '202 Accepted' means the request has been accepted and the processing is being done.

We need to think that not all successful(in some sense) requests are '200 OK'. According to the result of a request the status code need to be chosen. Example, for validation errors the status code must be '422 Unprocessable Entity' and when a request fails due to the lack of a payment plan the status code need to be '402 Payment Required'.

Status codes speaks by itself and can thus make api communication more meaningful. Read the wikipedia page for more info. https://en.wikipedia.org/wiki/List_of_HTTP_status_codes

Hot sauce if you're wrong - web dev trivia for staff engineers

Hot sauce if you're wrong ยท web dev trivia for staff engineers (Chris vs Jeremy, Leet Heat S1.E4)

  • Shipping Fast: Test your knowledge of deployment strategies and techniques
  • Authentication: Prove you know your OAuth from your JWT
  • CSS: Demonstrate your styling expertise under pressure
  • Acronyms: Decode the alphabet soup of web development
  • Accessibility: Show your commitment to building for everyone

Contestants must answer rapid-fire questions across the full stack of modern web development. Get it right, earn points. Get it wrong? The spice level goes up!

Watch Video ๐ŸŒถ๏ธ๐Ÿ”ฅ

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

๐Ÿ‘‹ Kindness is contagious

DEV is better (more customized, reading settings like dark mode etc) when you're signed in!

Okay