Options¶
Content type flags¶
Flag |
Description |
|---|---|
|
Serialize data items as JSON (default) |
|
Serialize data items as form fields |
|
Force multipart form data |
Output control¶
When connected to a terminal, the default output includes response headers and
body. If rich is installed, JSON, HTML, and XML bodies are syntax
highlighted. When piped, only the body is printed as plain text.
Flag |
Description |
|---|---|
|
Print request headers, request body, response headers, and response body |
|
Print response headers only |
|
Print response body only |
|
Fine-grained control using a string of characters:
|
# Headers only
curl-cffi get --headers https://httpbin.org/get
# Body only (no headers)
curl-cffi get --body https://httpbin.org/get
# Full verbose output
curl-cffi post -v https://httpbin.org/post name=test
# Custom: request headers + response headers
curl-cffi get -p Hh https://httpbin.org/get
Download¶
Downloads display a progress bar with transfer speed when rich is installed.
Without rich, the download is written with plain text output. Filenames are
automatically sanitized to remove unsafe characters.
Flag |
Description |
|---|---|
|
Download response body to a file (filename from |
|
Specify output file path |
# Download a file
curl-cffi get --download https://example.com/file.zip
# Download to a specific path
curl-cffi get --download -o myfile.zip https://example.com/file.zip
Connection options¶
Flag |
Description |
|---|---|
|
HTTP authentication ( |
|
Enable/disable SSL certificate verification (default: enabled) |
|
Proxy URL |
|
Request timeout in seconds |
|
Follow/don’t follow redirects (default: follow) |
|
Maximum number of redirects (default: 30) |
# Basic auth
curl-cffi get -a user:password https://httpbin.org/basic-auth/user/password
# Skip SSL verification
curl-cffi get --no-verify https://self-signed.example.com
# Use a proxy
curl-cffi get --proxy http://proxy:8080 https://httpbin.org/get
# Set timeout
curl-cffi get --timeout 5 https://httpbin.org/delay/3
Browser impersonation¶
Flag |
Description |
|---|---|
|
Browser to impersonate (default: |
# Impersonate Chrome (default)
curl-cffi get https://tls.browserleaks.com/json
# Impersonate Safari
curl-cffi get -i safari https://tls.browserleaks.com/json
# Impersonate Firefox
curl-cffi get -i firefox https://tls.browserleaks.com/json