--json
without request items omits body instead of sending empty object
#1263
Labels
bug
Something isn't working
needs product design
We like the idea, but we want to explore the problem deeper, and consider the solution holistically
Checklist
Minimal reproduction code and steps
Run
http --offline --json post :
Current result
A request with
Content-Type: application/json
and an empty body is sent.Expected result
{}
is sent as a body.It seems to me that HTTPie shouldn't construct an invalid JSON body if it picks a JSON content type.
(Without the
--json
flag noContent-Type
header is sent, so everything's fine.)See also:
--json
with no request items omits body entirely instead of providing empty object ducaale/xh#218--json
with empty body doesn't set Content-Type #137The text was updated successfully, but these errors were encountered: