You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given that the upstream issue has been closed with no action, I think we should go with @blyxxyz's solution i.e. don't set Content-Type unless there is a JSON body.
httpie/cli#137 already decided opposite by making explicit --json add a Content-Type header, so then maybe that should be reverted instead? Right now it's inconsistent.
If I do a request like
xh -p HBhb POST http://example.com --json
the outgoing request looks likeNotice the complete lack of any body despite
Content-Type: application/json
. This is an invalid JSON body.In the absence of request items, passing
--json
should pass the body as{}
.The text was updated successfully, but these errors were encountered: