Skip to content

Instantly share code, notes, and snippets.

@davidbarkhuizen
Last active May 11, 2016 08:32
Show Gist options
  • Select an option

  • Save davidbarkhuizen/2f0d0a8e9eb8a47b6cc273d2abf1b166 to your computer and use it in GitHub Desktop.

Select an option

Save davidbarkhuizen/2f0d0a8e9eb8a47b6cc273d2abf1b166 to your computer and use it in GitHub Desktop.
http://stackoverflow.com/questions/14978411/http-post-and-get-using-curl-in-linux
# make post request with json loaded from file post.json
curl -X POST -d @post.json http://example.com/path/to/resource --header "Content-Type:application/json"
# make a get request, accepting all content tyopes
curl -i -H "Accept: *" -H "Content-Type: application/json" -X GET http://hostname/resource
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment