Drake Drake - 5 months ago 32
JSON Question

How to make a post with a from data of empty json through HTTPie?

I'm wondering how to make a POST request with a from data of empty json through HTTPie? The corresponding Curl solution is here:

curl -X POST -H "Content-Type: application/json" -d '{}' http://ooxx.asdf/

Answer

Verbatim request data can be specified via redirected STDIN:

$ echo '{}' | http httpbin.org/post

Note that for requests with body: