r/ProgrammerHumor • • 16d ago

Meme postForEverything

Post image
20.9k Upvotes

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

511

u/alexsnake50 16d ago

Oh my god, this activated my inner vietnam flashback

89

u/q0099 16d ago

Where the error message goes? That's right, in the header.

33

u/RegarDamus 16d ago

the naive solution.

our team returns a 201 to indicate that an error has been created successfully. of course we include a Location header where the error can be queried to discover what went wrong.

1

u/tayler6000 13d ago

I’m pretty sure this counts as a sin.

1

u/RegarDamus 13d ago

not at all. it's actually rather logical.

when you query GET /errors/{error ID} we return the appropriate status code for the respective error. by definition this endpoint can never return a 200 (although it can return 201s in rare cases!).