curlチートシート
API デバッグと自動化のための HTTP クライアントコマンド:メソッド、JSON ペイロード、ヘッダー、認証、マルチパートアップロード、Cookie、リトライ、curl 8.x での TLS 診断。
動作の仕組み
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.
サバイバルキット
最初に覚えるべき最小限のコマンド。
42 件のコマンド
Requests & Methods
Send GET, HEAD, POST, PUT, PATCH, and DELETE requests with clean headers.
- 基本
Fetch a URL and print the response body to stdout
curl <url>コマンドを組み立てる
curl <url>値は入力した通りにそのまま挿入されます。空白や特殊文字を含む場合は、必要に応じて引用符で囲んでください。
使いどころ
Baseline check for reachability, response payload, and pipe integration with jq.
実例
curl https://api.example.com/health実行結果
{"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.