Cheatsheet: curl
Last updated 2026-06-21
Requests and methods
Send a GET request to a URL.
Send a POST request with form-encoded data.
Send a POST request with a JSON body.
Send a PUT request with data.
Send a DELETE request.
Use a custom HTTP method such as PATCH.
Headers and authentication
Send a request with a custom header.
Send a bearer token for OAuth-style API authentication.
Send a request with Basic Authentication.
Include response headers in the output.
Send only a HEAD request to fetch headers.
Downloads and output
Save the response body to a specific file.
Download a file using the remote filename from the URL.
Follow redirects while downloading or calling an endpoint.
Resume an interrupted download.
Fail on HTTP errors and show the error body when available.
Debugging and options
Show verbose connection details including request and response headers.
Print only the HTTP status code and discard the response body.
Set connection and overall request timeouts.
Send cookies in a request.
Save cookies from a response and reuse them later.
Submit multipart form data, including a file upload.
Upload raw file contents with PUT.
Ignore TLS certificate validation for local testing only.
See also: