curl 치트시트
API 디버깅과 자동화를 위한 HTTP 클라이언트 명령어: 메서드, JSON 페이로드, 헤더, 인증, 멀티파트 업로드, 쿠키, 재시도 및 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.