Last active
December 29, 2015 23:28
-
-
Save jessereynolds/7742575 to your computer and use it in GitHub Desktop.
which curl form do you prefer? Both do the same thing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat examples/contacts_ada_and_charles.json | \ | |
curl -w 'response: %{http_code} \n' -X POST -H "Content-type: application/json" \ | |
-d - http://localhost:3081/contacts | |
curl -w 'response: %{http_code} \n' -X POST -H "Content-type: application/json" \ | |
-d - http://localhost:3081/contacts < examples/contacts_ada_and_charles.json | |
curl -w 'response: %{http_code} \n' -X POST -H "Content-type: application/json" \ | |
-d @examples/contacts_ada_and_charles.json \ | |
http://localhost:3081/contacts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
pip install httpie http POST http://localhost:3081/contacts < examples/contacts_ada_and_charles.json
https://github.com/jkbr/httpie