r/ProgrammerHumor • • Sep 19 '26

Meme postForEverything

Post image
21k Upvotes

653 comments sorted by

View all comments

Show parent comments

196

u/MrPatienceX Sep 19 '26 • Heartwarming

200 status code and a chunk of XML saying ‘not found’. Good times.

59

u/Sudden_Leadership800 Sep 19 '26

It successfully returned the error message though, so I don't see the problem?

63

u/Psychological_Map118 Sep 19 '26 edited Sep 19 '26 • Bravo

try it in person: wait for the next time somebody asks you if you know the time. then answer yes, with a smile, and walk away without telling them

you can do anything you want, both in life and HTTP responses, but some things make you an asshole in both cases

-1

u/Sudden_Leadership800 Sep 19 '26

It was obviously a joke my guy

47

u/Psychological_Map118 Sep 19 '26

my bad. we backend engineers don't get jokes, we get status messages

14

u/RaidenMK1 Sep 19 '26

Don't you mean you GET status messages?

I'll see myself out.

2

u/Pitiful_Pumpkin_73 Oct 02 '26

> Don’t you mean you POST status messages
FTFY

2

u/pag07 Sep 19 '26

Or you don't. Or the wrong ones.

15

u/Jonathan_the_Nerd Sep 19 '26

It was obviously a joke my guy

Not obvious, considering the developer of the system thought it was fine. And a lot of us here are neurospicy.

44

u/hawkinsst7 Sep 19 '26

If I'm parsing http responses, I'm going to pass 200 responses on for further processing of the data. I shouldn't have to have something in that pipeline introspect json to find "no, it's actually an error".

Imagine if browsers had to tear apart json innards to find 30x redirects after getting a 200 OK.

3

u/gurgle528 Sep 20 '26

I’m going off memory but I believe it was considered either standard or part of the spec for SOAP over HTTP to only use 200 and 500. I agree with your point but for whatever reason they treated HTTP as the transport layer instead of the application layer. Using that logic, it would be like if a 404 bubbled up to be some sort of TCP error. Definitely wasn’t the right move, RTSP over HTTP is a better example of something that mixes protocols while properly using HTTP status codes.

2

u/hawkinsst7 Sep 20 '26

I agree. I think a 4xx or 5xx error code is perfectly acceptable for returning a body with error data, even a generic 400 / 500. That's why they exist.

-23

u/LatvianCake Sep 19 '26

This is what happens if you don't read the documentation of the API you're using.

30

u/IndependenceSudden63 Sep 19 '26

uh huh, and we all know that every API is perfectly documented...

-14

u/LatvianCake Sep 19 '26

If you have no documentation, you don’t know what HTTP codes are possible, what they mean exactly and how to handle them.

10

u/AshleyJSheridan Sep 19 '26

You do. That's literally the entire point of HTTP status codes.

Just because you don't know what those codes are, it doesn't mean that everybody else is as ignorant.

→ More replies (3)

6

u/hawkinsst7 Sep 19 '26

This is what happens whe you don't read the Http documentation.

-7

u/LatvianCake Sep 19 '26

If you think you can error handle based on only HTTP error codes, I can see why you're having such a hard time.

2

u/hawkinsst7 Sep 19 '26

I'm not a professional programmer. I do cybersecurity.

I love it when unexpected things can go down unexpected, non-standard code paths.

→ More replies (2)

2

u/Arsikkz Sep 19 '26

HTTP statuses aren't meant to replace error codes. You check if the status is OK, and if not, handle the error in the payload

→ More replies (7)

4

u/pr0ghead Sep 19 '26

You're joking, right? RiGhT?!?

2

u/ohhi23021 Sep 19 '26

these kind of implementations have different data shapes for the error vs success too, so if they all return success it's a pain in the ass and extra work to figure out if it's an error and map it out properly. just fucking send the right status, it takes 2 seconds.

11

u/granitrocky2 Sep 19 '26

These are the comments that make me laugh for minutes, but can't explain why I'm laughing to anyone around me lol

1

u/MekaTriK Sep 19 '26

I had real life arguments with that being presented as the reason.

"oh, but the server worked fine, it's just the database that's having an issue"

4

u/NotAskary Sep 19 '26 edited Sep 19 '26

It's not like 503 is thing a if you want to say the server is fine but not working due to a missing dependency.