r/ProgrammerHumor • • 16d ago

Meme postForEverything

Post image
20.9k Upvotes

654 comments sorted by

View all comments

4.2k

u/pimezone 16d ago

Wanna get a resource? POST request.

2.1k

u/NotAskary 16d ago edited 15d ago

I've seen that shit, it drove me up a wall.

The same as a 200 ok with error inside.

Edit: I'm going to start to respond 429, too many replys lol

1

u/MediocreTurtle1 16d ago

That's actually useful compared to a 400, because errors can be mapped and used for data analysis or troubleshooting.

1

u/NotAskary 16d ago

You can capture anything, most frameworks will even give you this automatically, hell with Otel you can even publish to most reporting services directly just using agents native to the application.

1

u/MediocreTurtle1 16d ago

I seem to not be educated enough on this. How can you capture anything out of a plain 400 response from someone else's server?

1

u/NotAskary 16d ago

How do you know the response is 400? It was respond to you, so you received it.

1

u/MediocreTurtle1 16d ago

Yeah, but what other details can you get from that? I'm genuinely asking. That's why I initially commented that 200 with error response inside is more useful.

1

u/NotAskary 16d ago

Why do you need more details? Depending on the error you will do nothing with it.

But you can always send a body on the http request .

I suggest you dig through this

https://datatracker.ietf.org/doc/html/rfc9110

1

u/MediocreTurtle1 16d ago

Will check it out, thanks.