Cheatsheet do curl
Comandos de cliente HTTP para depuração de APIs e automação: métodos, payloads JSON, cabeçalhos, autenticação, uploads multipart, cookies, retentativas e diagnósticos TLS no curl 8.x.
Como funciona
curl transfers URL data from the shell: set method (-X), headers (-H), body (-d/-F), and output (-v/-i/-w) explicitly, because curl prints only the response body by default.
Kit de sobrevivência
Os principais comandos para aprender primeiro.
42 comandos
Requests & Methods
Send GET, HEAD, POST, PUT, PATCH, and DELETE requests with clean headers.
- Essencial
Fetch a URL and print the response body to stdout
curl <url>Montar o comando
curl <url>Os valores são inseridos exatamente como digitados. Coloque entre aspas você mesmo se contiverem espaços ou caracteres especiais.
Quando usar
Baseline check for reachability, response payload, and pipe integration with jq.
Exemplo
curl https://api.example.com/healthResultado
{"status":"ok","version":"2.4.0"}
Payloads, Forms & Files
Send JSON, URL-encoded forms, multipart uploads, and binary bodies.
Auth, Cookies & TLS
Authenticate requests, manage cookies, resolve hosts, and verify certificates.
Headers, Timing & Debugging
Inspect TLS handshakes, response headers, status codes, and per-phase latency.
Downloads, Retries & Limits
Write files safely, resume interrupted downloads, cap wait time, and retry.