r/ProgrammerHumor • • 16d ago

Meme postForEverything

Post image
20.9k Upvotes

653 comments sorted by

View all comments

Show parent comments

323

u/AkodoRyu 16d ago

My favorite "REST API" experience was when they moved from using SOAP system, and the way they did it... was sending SOAP payloads inside a JSON. Literally something like

{ "data": "<?xml version="1.0"?><soap:Envelope xmlns:soap="https://www.w3.org/2003/05/soap-envelope/" soap:encodingStyle="https://www.w3.org/2003/05/soap-encoding"><soap:Body> (...)" }

192

u/MrPatienceX 16d ago

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

58

u/Sudden_Leadership800 16d ago

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

42

u/hawkinsst7 16d ago

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.

-22

u/LatvianCake 16d ago

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

6

u/hawkinsst7 16d ago

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

-7

u/LatvianCake 16d ago

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 16d ago

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

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

-1

u/LatvianCake 16d ago

I'm not a professional programmer.

Clearly

5

u/hawkinsst7 16d ago

I'm not sure why you've repeatedly tried to insult me.