30 Days of API Testing Day 23: Resources For Understanding Status Codes

30 Days of API Testing Day 23 challenge is:

Status codes are often misused, share your favourite resources for understanding status codes.

I’m quite a visual learner, a picture paints a thousand words and all that :sweat_smile:

I’ve found the HTTP status dogs, in particular, the ones that @g33klady has on her blog, to be the most useful for me in understanding status codes.

6 Likes

Very interesting pictures which are very understandable :grinning:

There is no doubt that MDN web docs is a helpful resource for developers to understand status codes.

3 Likes

The article from wikipedia is a very comprehensive list about HTTP status codes.

3 Likes

The first resource I think about is on Wikipedia: List of HTTP status codes - Wikipedia
It contains all HTTP status code.

However, while working to understand details about a status code, I usually google it like that: “XXX HTTP code”. Google will return it very quickly.

Btw, thanks to @brian_seg for the lovely resource.

https://club.ministryoftesting.com/t/30-days-of-api-testing-day-23-status-codes-are-often-misused-share-your-favourite-resources-for-understanding-status-codes/20300/2?u=tuanatran

I am looking for a cat-version for the cat-lover :smiley: :heart_eyes_cat:

3 Likes

ask and you shall receive: https://http.cat/

4 Likes

I’m a visual learner as well!

I couldn’t find the particular resource I was looking for, but I did find this & it helps me communicate the status codes with non-techies:

2 Likes

The most concise list I could find! :smiley:

HTTP Status Code Summary (via @stevelosh)

1xx: hold on
2xx: here you go
3xx: go away
4xx: you f$%ed up
5xx: I f$
%ed up

3 Likes

Finally the HTTP Status Map is a useful interactive resource in the style of a tube / metro map.

4 Likes

Thanks for your information. I love it :heart_eyes_cat:

My favourite resource is https://www.restapitutorial.com/httpstatuscodes.html, it is categorized, hence easy to find, and remember

5 Likes

Amusing and accurate.

Generally the only rule I manage to remember off by heart is the difference between a 4xx and a 5xx.

If the request is and will never be correct in its current form it’s a 4xx, if the user can send that same request without alteration at a later date and expect the server to respond correctly, it’s a 5xx.

Nice refinement Will :slight_smile:

Working with developers I encourage them to use more specific error status codes and have found things have improved over the years, everything is no longer a 200 :slight_smile:
But generally for a simple API most implementations are
200 - all good
404 - couldn’t find it
500 - service down etc.

My preference is for granularity
If a post created data then return a 201.
e.g. create new user

If the server has successfully fulfilled the request and that there is no content to send in the response payload body, then return a 204.
e.g. save document and allow user to continue editing.

Any thoughts?

3 Likes

Understanding HTTP through quotes:

HTTP 100: “Hold the vision, trust the process.”
HTTP 200: “This is the beginning of anything you want. If you can dream it, you can achieve it!”
HTTP 300: " As I look back on my life, I realize that every time I thought I was being rejected from something good, I was actually being re-directed to something better."
HTTP 400: “When someone does something wrong, don’t forget all the things they did right.”
HTTP 500: “I’ve always loved the idea of not being what people expect me to be” / Server

3 Likes

definitely agree on this one - much better than everything getting a 200 and then having some kind of message in the response about what actually happened.
It makes it more user friendly, and usable for other APIs to pick up without having to do special handling

2 Likes

Loved pics, awesome stuff

All the resources about HTTP Status Codes above are great! I just share a bit info from the origin of HTTP protocol.

2 Likes

This was a very busy day on Twitter!

1 Like

I find resources for understanding Status Codes:

  1. https://httpstatuses.com/
  2. https://www.checkupdown.com/status/
4 Likes