Last active
August 29, 2015 14:20
-
-
Save wwwbruno/284263f23fdfca7c3b17 to your computer and use it in GitHub Desktop.
curl simple usage example
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
# 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