curl

CLI

Transfer data from or to a server using various protocols.

1 views

Installation

aptsudo apt install curl
Homebrewbrew install curl

Links

License

curl (MIT-like)

AI Agent Notes

Universal URL transfer tool supporting HTTP, FTP, SMTP and more

When to use

Downloading files, calling APIs, scripting HTTP requests

Examples
  • curl -s https://api.example.com/data
  • curl -X POST -d '{"key":"val"}' -H 'Content-Type: application/json' URL

Proven Recipes

GET request with JSON output🟢 99% success
curl -s https://api.example.com/data | jq '.'
POST JSON data🟢 97% success
curl -s -X POST -H 'Content-Type: application/json' -d '{"key":"value"}' https://api.example.com/endpoint
⚠ Common failures (1)
  • 415 Unsupported Media TypeEnsure -H 'Content-Type: application/json' is included
Download file🟢 98% success
curl -L -o output.zip https://example.com/file.zip
⚠ Common failures (1)
  • File is HTML instead of binaryAdd -L to follow redirects
Send request with auth bearer token🟢 98% success
curl -s -H 'Authorization: Bearer TOKEN' https://api.example.com/me