Curl Command Cheatsheet
Curl Command Cheatsheet
$ curl http://example.com Fetch a URL $ curl --cert mycert.pem https://example.com Use SSL Certificate
COMMAND DESCRIPTION -f, --fail Fail fast with no output on HTTP errors
$ curl -d "key1=value1&key2=value2" Post Data -h, --help <category> Get help for commands
http://example.com/post_endpoint
-1, --include Include protocol response headers in the output
$ curl -d '{"key1":"value1", "key2":"value2"}' POST JSON Data
-H "Content-Type: application/json" http://example.com/api --output <file> Write to file instead of stdout
$ curl -F "file=@path_to_file" http://example.com/upload Upload a file -0, --remote-name Write output to a file named as the remote file
$ curl -u username:password HTTP Basic Authentication -A, --user-agent <name> Send User-Agent <name> to server