Skip to content

Instantly share code, notes, and snippets.

@wwwbruno
Last active August 29, 2015 14:20
Show Gist options
  • Save wwwbruno/284263f23fdfca7c3b17 to your computer and use it in GitHub Desktop.
Save wwwbruno/284263f23fdfca7c3b17 to your computer and use it in GitHub Desktop.
curl simple usage example
# Get json
$ curl -i -H "Accept: application/json" --user user:pass http://disvolvi.com/api/v1/list.json
# Post xml
curl -X POST -i -H "Accept: application/xml" -d '<?xml version="1.0"?><instance></instance>' --user user:pass http://disvolvi.com/api/v1/post.xml
# Return info from the return
-i
# Header type json
-H "Accept: application/json"
# Header type xml
-H "Accept: application/xml"
# User credentials for http basic authentication
--user user:pass
# Set request as post
-X POST
# Send xml content
-d '<?xml version="1.0"?><instance></instance>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment