Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 859 Bytes

curl.md

File metadata and controls

45 lines (31 loc) · 859 Bytes
tags
tools

good curl online help page

display out: -v (or more compact and for regular case -i) header -H '' -H 'accept: /'
-H "Authorization: $apiKey"
-H 'Content-Type: application/json' \

request type -X

request body -d '{"json": "data"}'

handle redirect -L

disable progress output -s (--silent)

POST

curl --data "{ 'a': 1 }" http://host.co/path
curl -d "{ 'a': 1 }" http://host.co/path

Set header

curl --header "X-MyHeader: 123" -H "X-Myheader2: 456" http://host.co

HTTP Basic Authentication

curl --user name:password http://host.co

Download files

curl -O https://server.co/my/file.txt # will download file.txt
curl -o my-file.txt https://server.co/my/file.txt # will download file.txt by name my-file.txt