
Requests
6 entries| Syntax | Description |
|---|---|
curl https://example.com/ | GET a URL |
curl -I https://example.com/ | Headers only (HEAD) |
curl -i https://example.com/ | Include response headers |
curl -X PUT URL | Set the HTTP method |
curl -X DELETE URL | DELETE a resource |
curl -X PATCH URL | PATCH a resource |
Bodies
6 entries| Syntax | Description |
|---|---|
curl -d "a=1&b=2" URL | POST form-encoded data |
curl -d @file.txt URL | POST body from a file |
curl --json '{"ok":true}' URL | POST JSON with type headers |
curl --json @data.json URL | POST JSON from a file |
curl -F "[email protected]" URL | Multipart file upload |
curl --data-urlencode "q=a b" URL | URL-encode a field |
Headers and auth
6 entries| Syntax | Description |
|---|---|
curl -H "Accept: application/json" URL | Add a request header |
curl -H "Authorization: Bearer TOKEN" URL | Send a bearer token |
curl -u user:pass URL | HTTP Basic auth |
curl -A "MyAgent/1.0" URL | Set User-Agent |
curl -e https://referrer.example/ URL | Set Referer |
curl -b "sid=abc" URL | Send a Cookie header |
Output
6 entries| Syntax | Description |
|---|---|
curl -o file.bin URL | Write the body to a file |
curl -O URL | Save using the remote filename |
curl -sS URL | Silent progress, still show errors |
curl -v URL | Verbose request and response |
curl -w "%{http_code}\n" -o /dev/null -s URL | Print the status code |
curl --compressed URL | Ask for compressed content |
Redirects and TLS
5 entries| Syntax | Description |
|---|---|
curl -L URL | Follow redirects |
curl -k URL | Skip TLS certificate check |
curl --cacert ca.pem URL | Trust a custom CA file |
curl --cert client.pem --key key.pem URL | Send a client certificate |
curl --tlsv1.2 URL | Require TLS 1.2 or newer where supported |
Timeouts and scripts
6 entries| Syntax | Description |
|---|---|
curl --connect-timeout 5 URL | Cap the connect phase |
curl --max-time 30 URL | Cap the whole transfer |
curl -f URL | Fail on HTTP error status |
curl --fail-with-body URL | Fail on HTTP error, keep the body |
curl -fsSL URL | Silent, fail, show errors, follow redirects |
curl -D headers.txt URL | Write response headers to a file |
Sources
1 entries| Syntax | Description |
|---|---|
| curl manual: HTTP requests, redirects, authentication, TLS, and script options. |
Related Cheatsheets
Web DevelopmentNew
React Hooks

useState, useEffect, useRef, useMemo, React 19 hooks, and custom hook patterns
Web Development
CSS Flexbox

Flex container and item properties, alignment, ordering, and common layout patterns
Web Development
CSS Grid

Grid container and item properties, template areas, auto-placement, and responsive grids