Chuleta de curl
Comandos del cliente HTTP para depuración de API y automatización: métodos, cargas JSON, cabeceras, autenticación, subidas multipart, cookies, reintentos y diagnóstico TLS en curl 8.x.
Cómo 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 supervivencia
Los comandos clave que conviene aprender primero.
42 comandos
Requests & Methods
Send GET, HEAD, POST, PUT, PATCH, and DELETE requests with clean headers.
- Esencial
Fetch a URL and print the response body to stdout
curl <url>Construye el comando
curl <url>Los valores se insertan exactamente como los escribes. Ponlos entre comillas si contienen espacios o caracteres especiales.
Cuándo usarlo
Baseline check for reachability, response payload, and pipe integration with jq.
Ejemplo
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.