Hacker News new | past | comments | ask | show | jobs | submit login

In the case of a missing user ID, if a more verbose response is desirable, why not put the error message in the body of the response?

404: Route not found vs 404: User ID not found seems like it resolves all ambiguity, no?




Straight answer: HTTP 2 and 3 killed that (they only send codes, not an arbitrary message)


In the headers, yes. But you can still put whatever you want in the response body alongside that 404 code in the header


They can still send bodies, which is where GP said the message should be.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: