Funny way to learn about HTTP client error codes
I created this joke to illustrate some of the common HTTP status codes that we use in our services to indicate the errors on the client side.?
Imagine that you have a shared bank locker. The bank requires you to complete a form for any locker operations, so you fill it up and approach the bank officer.
Bank Officer: 400 Bad Request. You have left out some of the mandatory form fields, especially the locker number is blank.
You fill in all the fields this time and pass it again.?
Bank Officer: 401 Unauthorized. The customer ID entered in the form is not in our records.
You verify and correct the customer ID.?
Bank Officer: 401 Unauthorized. Your signature does not match the one we have on record.
You recall the sign you used and fill in another form with an adjusted signature.
Bank Officer: 404 Not Found. The locker number does not exist.
领英推荐
You try to remember and update the form with a new guess for the locker number.
Bank Officer: 403 Forbidden. This locker number exists, but you do not own it.
You finally call home to get the correct number and update the form again.
Bank Officer: 405 Method Not Allowed. You stated in the form that you also want to upgrade the locker to a bigger one. That service is not available for the type of locker you have.
You agree and change your request to only get access to open the locker.?
Bank Officer: 409 Conflict. There is already a person in the locker room right now.
You wait for some time and reach out to the officer again.
Bank Officer: 429 Too Many Requests. Our records show that you have already accessed the locker twice this week. You have hit our weekly limit. Please Retry-After a day.
You go to the bank the next day.
Bank Officer: 410 Gone. This locker was closed by the other owner. Goodbye!