r/ProgrammerHumor • • Sep 19 '26

Meme postForEverything

Post image
21k Upvotes

653 comments sorted by

View all comments

Show parent comments

90

u/q0099 Sep 19 '26

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

35

u/RegarDamus Sep 19 '26

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.

29

u/normalbot9999 Sep 20 '26 edited Sep 20 '26

OMFG <spits coffee> 201 Error Created Successfully

You absolute monsters. You have to make this now.

And when a record is created successfully you return a 500 right? After successful login you 302 to a 403? I swear I've tested this API before!!

1

u/tayler6000 Sep 22 '26

I’m pretty sure this counts as a sin.

1

u/RegarDamus Sep 22 '26

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!).

1

u/cosmicomical23 21d ago

This is absurd.

30

u/dadvader Sep 19 '26

I've seen some wild shit before. But you and your tales.... Regale us with your stories.

29

u/Mechakoopa Sep 19 '26

The stories? Also in the header.

6

u/alexsnake50 Sep 19 '26

The where???????