httpbin icon indicating copy to clipboard operation
httpbin copied to clipboard

Include body in /status responses

Open greenmooseSE opened this issue 5 years ago • 1 comments

To test reading response body for status codes I would like an option for httpbin to return a body in the response, either by default or e.g. by using query string parameter https://httpbin.org/status/500?body=SomeBody

(In comparison, httpstat.us returns a plain text body if no accept header is given, and a application/json body if accept: application/json header is supplied. See below for example image )

greenmooseSE avatar Nov 23 '20 13:11 greenmooseSE

Agree that this would be useful. For example to validate that 400 status messages with a json response detailing the reason it was a bad request can be handled.

Another option could be to support combinations like https://httpbin.org/status/500/json

peterlundberg avatar Aug 29 '22 15:08 peterlundberg