curl [options] [URL]
Basic curl command structure. Options modify the behavior, and URL specifies the target.
A comprehensive cheat sheet for Curl, covering essential commands, options, and examples for effective command-line data transfer. Includes authentication, request types, data handling, SSL, and more.
Basic curl command structure. Options modify the behavior, and URL specifies the target. |
Simplest usage: retrieves the content of example.com and prints it to standard output. |
|
Saves the output to the specified file instead of printing to stdout. Example: |
|
Enables verbose mode, showing detailed information about the request process (headers, connection details, etc.). Example: |
|
Silent mode. Doesn’t show progress meter or error messages. Useful for scripts. Example: |
|
When used with Example: |
|
Includes the HTTP headers in the output. Example: |
|
Performs a HEAD request, retrieving only the HTTP headers. Good for checking resource status. Example: |
|
Adds a custom header to the request. Example: |
|
Requests a compressed response using deflate or gzip. Example: |
|
Specifies the HTTP request method (e.g., GET, POST, PUT, DELETE). Example: |
|
Follows HTTP redirects. Useful when a resource has moved. Example: |
|
Sends data with the HTTP GET method. Example: |
|
Sends HTTP POST data, URL-encoded. Example: |
|
Sends data from a file as HTTP POST data. Example: |
|
Used for multipart/form-data, typically for file uploads. Example: |
|
Provides username and password for HTTP authentication. Example: |
|
Use HTTP Basic Authentication (default when using Example: |
|
Use HTTP Digest Authentication Example: |
|
Specifies the CA certificate file for verifying the server’s certificate. Example: |
|
Specifies a directory containing CA certificates. Example: |
|
Skips SSL certificate verification. Use with caution! Example: |
|
Specifies the client certificate file. Example: |
|
Specifies the client certificate type (DER, PEM, ENG). Example: |
–key |
Private key file name (SSL) Example: |
|
SSL ciphers to use Example: |
|
Force curl to use specified TLS version. Example: |
|
Allow security flaws present in older SSL/TLS versions Example: |
|
Sends a cookie with the request. Example: |
|
Reads cookies from a file. Example: |
|
Stores received cookies in a file. Example: |
Sets the User-Agent header. Example: |
|
Fail silently (no output at all) on HTTP errors. Example: |
|
Retry request specified number of times if transient problems occur Example: |
|
Maximum number of redirects allowed Example: |