curl https://example.comThe basic curl invocation fetches a URL and prints the response body to stdout.
High-coverage curl commands for HTTP requests, APIs, downloads, uploads, cookies, redirects, and automation.
Core requests, saving output, redirects, and response metadata.
curl https://example.comThe basic curl invocation fetches a URL and prints the response body to stdout.
curl -L https://example.comUse `-L` or `--location` when you expect redirects from short links, login gateways, or moved pages.
curl -O https://example.com/file.tar.gz`-O` uses the remote path basename for the local filename.
curl -o response.html https://example.com`-o` lets you control the destination filename.
curl -i https://example.com`-i` includes response headers in the output stream.
curl -I https://example.comUseful for checking status, content type, caching headers, or redirects.
curl -sS https://example.com`-sS` is a common scripting pattern that keeps output clean while surfacing failures.
curl -s -o /dev/null -w 'status=%{http_code} time=%{time_total}
' https://example.com`-w` / `--write-out` is great for monitoring, scripts, and diagnostics.
curl --fail -sS https://api.example.com/data`--fail` is useful in scripts so error responses do not look like success.
curl --globoff 'https://example.com/items[1]'curl supports URL globbing; `--globoff` disables it when special characters should be treated literally.
Methods, query strings, headers, cookies, referer, and user agent.
curl -X POST https://example.com/resourceUsing `-X POST` changes the method even without request data.
curl -X DELETE https://example.com/resource/123`-X` overrides the request method.
curl 'https://example.com/search?q=curl&sort=new'Quote URLs containing `&` to prevent shell interpretation.
curl --get --data-urlencode 'q=curl examples' https://example.com/search`--get` converts `-d` data into query string parameters.
curl -H 'Accept: application/json' https://api.example.com/itemsUse `-H` repeatedly to send multiple headers.
curl -A 'Mozilla/5.0 test-client' https://example.com`-A` / `--user-agent` sets the request's User-Agent.
curl -e 'https://example.com/from' https://example.com/toUseful when testing apps that rely on referer checks.
curl -b 'session=abc123; theme=dark' https://example.com`-b` / `--cookie` can send cookies inline or from a file.
curl -c cookies.txt https://example.com/loginCommonly paired with `-b cookies.txt` for session persistence.
curl -b cookies.txt -c cookies.txt https://example.com/profileThis is a common pattern for multi-step login flows.
Multipart forms, file uploads, binary payloads, and transfer tricks.
curl -F 'name=jon' https://example.com/form`-F` creates multipart form requests.
curl -F 'file=@./report.pdf' https://example.com/uploadPrefix a filename with `@` to upload its content.
curl -F 'file=@./image.png;type=image/png' https://example.com/uploadHandy when the server expects a precise MIME type.
curl -T ./artifact.zip https://example.com/artifact.zip`-T` / `--upload-file` is useful for HTTP, FTP, and other protocols.
curl --data-raw '{"ok":true}' https://api.example.com/items`--data-raw` avoids the special `@` file semantics of `-d`.
curl --data-binary @payload.bin https://api.example.com/uploadUse this for payloads where newlines and bytes must be preserved.
curl --data-urlencode 'message=hello world & more' https://example.com/submitThis escapes reserved characters for you.
curl -C - -O https://example.com/large.iso`-C -` auto-detects the current file size and requests the remainder.
curl -r 0-1023 https://example.com/bigfile.bin -o first-kb.binUseful for partial downloads, debugging, and media requests.
curl --parallel --parallel-max 4 -O https://example.com/a.iso -O https://example.com/b.isocurl supports parallel transfers in recent versions.