Putting detailed REST error message in HTTP Warning header, good/bad idea?

Why not just change the reason phrase? That’s what it is there for. The “Bad Request” text is just the default. If you want to include more information then use the response body. The HTTP spec says you SHOULD include a response body with details of an error.


UPDATE

Based on a more recent reading of RFC 7231 and related material, it appears the only valid reason for changing the reason phrase is to localize the text, not to provide a more specific meaning. Sorry about that.

Leave a Comment