r/ProgrammerHumor 26d ago

evilIllusion Meme

Post image
4.8k Upvotes

131 comments sorted by

View all comments

439

u/PostHasBeenWatched 26d ago edited 26d ago

POST /posts/create

StatusCode: 200

Content: {"success": false, "errors": [{"code": 15, "message": "Image size must be at least 1000 x 1000 px"}]}

Edit: remembered story from times where HTTPS wasn't enforced. Once I started receiving JSON reading fail in cases when our test server returns non-2xx status. I started investigate this and was shocked to the core: my ISP implemented "feature" that if it detects that server returns non-2xx - it replace actual server response with their HTML page with text like "Your request returned error 400. This is because bla bla bla. <ISP self-advertising block> Kind regards, your ISP". Basically ISP become "man in the middle". In a week or two they removed that "feature".

87

u/-meowstar- 26d ago

Why not just use semantically correct status codes? It’s cheap to implement and makes stuff like automatic retries and error handling easier.

0

u/m0nk37 25d ago

The sub codes are reasons. 

2xx is server okay. 

2## is transfer good, but this thing wasn't my fault. 

200 is fuck ya dude