Search code examples
pythonjsoncurlhttpie

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/

Solution

  • Verbatim request data can be specified via redirected STDIN:

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

    Note that for requests that include a body: