httpbin icon indicating copy to clipboard operation
httpbin copied to clipboard

feat(response-headers): allow custom body

Open jschmid1 opened this issue 4 years ago • 0 comments

It'd be helpful to have a way to define the response body when setting headers via the /respons-headers endpoint.

This may be solved by allowing to send headers or form-data rather than query args

http -f post :8000/response-headers X-Foo==Foo # <- send as query args
HTTP/1.1 200 OK
X-Foo: bar
{
    "Content-Length": "87",
    "Content-Type": "application/json",
    "X-Foo": "Foo"
}

Could be:

http -f post :8000/response-headers X-Foo:Foo  # <- send as header
HTTP/1.1 200 OK
X-Foo: bar
{
    "Content-Length": "87",
    "Content-Type": "application/json",
    // no extra body element
}

jschmid1 avatar Oct 21 '21 08:10 jschmid1