Common HTTP Status Code Scenarios

To be more familiar with the status code. Let us read a story.

A Group of friends Ramesh, Harry, Muskaan, Jenifer and Simran are exploring a new place.

Let’s go near them and find out what they are looking for.

Let’s listen to their conversation.

Ramesh: Hey friends! This place looks quite happening. My mother had asked me to get milk packets. Can anyone find out any dairy shop in this locality?

Muskaan: Hey Ramesh! Look there is a dairy shop over there.

Ramesh: Thank You! Muskaan I got the correct shop that I was looking for.

Ramesh got milk packets from the milk shop. So this resembles HTTP Status code 200: (Everything is gonna be ok/Success)

Harry: Even my brother had asked me to get puja items for the home inauguration. Friends help me out in finding out any puja shops in this locality.

Muskaan: Hey Harry, Congratulations. When is the housewarming ceremony?

Harry: Thank You! Muskaan. It’s the day after tomorrow.

Muksaan: So we have some time in hand. Let’s look for some shops here. Hey, Harry look there is a minimart over there. I think we can get puja items from there. Harry takes out his mobile for the list of puja items and goes near the counter of the minimart.

Harry: Hello Sir, do you have these puja items in your shops?

Shopkeeper: Sorry Sir! Right now these items are not available at our store.

Harry did not receive anything from the minimart. So this resembles HTTP Status code 204: (No Content)

Shopkeeper: Sir, you can get puja items in our other branch which is just next lane.

Harry gets the puja items from the other branch. So this resembles HTTP Status code 301: (Temporary Redirect)

Jenifer: Hey friends! it’s a Sunday. I have a visit to the church for prayers. Is there any church nearby?

Simran: I can not find any church nearby. Probably we can finish up our shopping here and go back to the church near your house.

Jenifer could not find a church. So this resembles HTTP Status code 404: (Not Found)

Harry: Hey Jenifer! I have heard about a science city park nearby which is very famous. Let me google and find out how far it is from here. Harry is inputting the park’s name into the google map but is unable to locate the place.

Jenifer: What happened Harry? How far it is from here.

Harry: Jenifer I couldn’t locate it on the map. Let me check if I typed it wrongly. Oops sorry! I typed it wrongly.

Harry mistyped the park name. So that he could not find out the location. So this resembles HTTP Status code 400: (Bad Request)

Harry: Hey Guys what’s the time now?

Muskaan: It’s 10:45AM

Harry: The science city park will be open till 11:00 am and it’s just a 10-minute walk from here. Let’s give it a try.

Muskaan: Ok Let’s go.

They could not find any public transport. So they are trying to walk fast to reach their destination. It was already 11:00 am by the time they reached Science city park. They requested the park authorities to allow them to get inside as it was just 11:00AM but the park authorities did not allow them to enter.

Harry and their friends were forbidden to enter the park because it was past 11AM. The park’s morning timings were from 8 AM to 11 AM. So this resembles HTTP Status code 403: Forbidden.

Ramesh: Hey Friends! I am really very hungry. Let’s have something from the coffee shop.

Simran: I want a coffee from the coffee machine. Simran goes near the coffee machine and realizes that she doesn’t have Rs. 10 coins to insert. She asks for Rs. 10 coins from her friends.

The coffee machine only allows coins to be inserted in order to get a cup of coffee.

Simran was trying with an Rs. 10 note instead of a coin which was not allowed. So this resembles HTTP Status code 405: Method Not allowed.

Harry: What is everyone ordering? I want pan pizza. Rest other order.

The waiter comes to take the order. He takes the order and responds back that the pan pizza is not available.

Harry: He is a little disappointed as he finds the person at the other table is eating pan pizza. So harry wants to enter the kitchen to find out. Since the Staff are only Authorized to enter the kitchen, Harry could not do anything. So he requested the waiter to check again in the kitchen as he badly wanted to have pan pizza.

Harry was not authorized to enter the coffee shop kitchen. So this resembles HTTP Status code 401: Unauthorized.

The waiter re-checks the kitchen and comes back again and tells Harry, sorry sir! we don’t have pan pizza.

Simran: Hey Harry, I visited this coffee shop earlier. The dishes mentioned in a menu card with Chef recommendation were usually good. I don’t remember exactly what we ordered last time. Let’s check the menu card and order.

Simran asks the waiter to get the menu card. The waiter gives the menu card to Simran. She found the menu card in the same old and torn condition as it was on the last visit.

Simran found the menu card has not been changed since her last visit. So this resembles HTTP Status code 304: Not Modified.

Harry ordered some other dishes from the menu card. It’s been more than half an hour, and food was not been served.

It was taking more time to serve the food. So this resembles HTTP Status code 504: Gateway Timeout.

The food was finally served after half an hour. The food was very delicious and everyone enjoyed it. So after the food, it was bill payment time. They opted to pay online. The phone pay transaction failed due to some server issues.

They had to pay offline at that time as the online service was unavailable. So this resembles HTTP Status code 503: Service unavailable.

Harry asked for the hard copy of the bill so that they can divide the bill amount. The waiter provided a handwritten bill instead of a printed one. On enquiring, the waiter said that the ink was over in the printer.

The printed bill could not be provided due to printer issues. So this resembles HTTP Status code 500: Internal Server Error.

After paying the bill, everyone started walking toward the exit door. Jenifer was looking at the chocolate counter and walking forward.
The glass doors were closed and Jenifer didn’t notice as her full attention was on the chocolate counter. As a result, she hit her head hard on the glass door.

So it was a bad gateway for Jenifer to exit. So this resembles HTTP Status code 502: Bad Gateway.

On the way back to their home, suddenly Ramesh came up with the idea of starting some business in the market locality they had visited.

Everyone appreciated his idea. So they all decided to visit that place again next weekend so that they can do some market study. On the very next weekend, all of them saw the place and came to the conclusion that there were no xerox shops available in that locality. Then Ramesh suggested, Hey Guys! Why not open a xerox shop in this locality? Since this place is near to the college, I think this business idea would click. What do you all say, guys?

After one month when they revisited that place of finding out a shop for their business, they found that the pharmacy has been moved permanently to another location.

The shop moved permanently from one location to another. So this resembles HTTP Status code 302: Permanent Redirect.

Since the pharmacy shop area was free, they all planned to start their business from there. They all found an auspicious day and inaugurated their xerox shop there.

A new shop/business was opened/created. So this resembles HTTP Status code 201: Created.
Xerox Shop added in the locality

Image courtesy of Sonal Kumar | APISetu | Blog

Authors

10 thoughts on “Common HTTP Status Code Scenarios

  1. Thank you for the kind words! I’m glad you found the examples helpful. Here’s a rewrite that includes how understanding HTTP status codes can help in the creation of my website, artax.in

Leave a Reply to Abhijeet Cancel reply

Your email address will not be published. Required fields are marked *