Last active
March 7, 2018 12:41
-
-
Save srMarquinho/84d08a1115df7a80a9de22d3d75dfe5b to your computer and use it in GitHub Desktop.
This file contains 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: | |
with JSON: | |
curl -i -H "Accept: application/json" -H "Content-Type: application/json" http://hostname/resource | |
as XML: | |
curl -H "Accept: application/xml" -H "Content-Type: application/xml" -X GET http://hostname/resource | |
curl -H "Accept: application/xml" "http://localhost:3040/api/org.xml" | |
curl -H "Accept: application/xml" -H "API_KEY: fgjfgjhfj68rvuIXy5XAlpRELmHKmOZNJeot62I3rePsnFAl15Wghjgs" "http://localhost:3040/api/org" | |
POST: | |
For posting data: | |
curl --data "param1=value1¶m2=value2" http://hostname/resource | |
For file upload: | |
curl --form "fileupload=@filename.txt" http://hostname/resource | |
RESTful HTTP Post: | |
curl -X POST -d @filename http://hostname/resource | |
DELETE: | |
curl -X DELETE http://hostname/resource | |
For logging into a site (auth): | |
curl -d "username=admin&password=admin&submit=Login" --dump-header headers http://localhost/Login | |
curl -L -b headers http://localhost/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment