curl cheat sheet
Hit an API with a token, post some JSON, upload a file, or find out exactly where a slow request spends its time.
In Snippet Keeper, click Import at the bottom of the sidebar and choose the file. They land in your curl app, and ones you already have are skipped. The highlighted parts become fill-in fields: type a value (or pick one), and the finished command is on your clipboard.
Requests
curl -i url
curl -I url
curl -L url
curl -X POST url \
-H "Content-Type: application/json" \
-d 'json'
curl -X POST url -H "Content-Type: application/json" --data @file
curl -X method url
curl -d "field=value" url
curl -F "file=@file" url
curl -s url | jq
Auth
curl url -H "Authorization: Bearer token"
curl -u user url
curl -c cookies.txt -b cookies.txt url
Downloads
curl -L -o file url
curl -LO url
curl -L -C - -O url
Debugging
curl -v url
curl -o /dev/null -s -w '%{http_code}\n' url
curl -o /dev/null -s -w 'dns %{time_namelookup}s connect %{time_connect}s tls %{time_appconnect}s first byte %{time_starttransfer}s total %{time_total}s\n' url
curl --resolve host:port:ip https://host/
curl -k url
curl --max-time seconds url
curl --retry count url
curl -x proxy url
Keep these one keystroke away.
Snippet Keeper is a Mac app for the commands you keep looking up. Press ⌥⇧Space in any app, type a few letters, fill in the blanks, and it’s on your clipboard.