curl
install via source
[!NOTE|label:references:]
environment
[!TIP]
centos:
gcc:appstreamlibssh2:@epellibssh2-devel:@epel:$ dnf install libssh2 libssh2-devel libssh2-docslibssh2-doc:@epelzlib:@centos-baseosbrotli:@centos-baseos:$ sudo dnf install brotli-devel.i686libpsl:@centos-baseosopenssl:@centos-baseoslibidn2:@centos-baseos
build
[!NOTE|label:references]
--prefix=/usr/localwill install in :/usr/local/lib/usr/local/bin/usr/local/include/usr/local/share
full configure
for issue:
undefined reference to 'BrotliDecoderCreateInstance':solution:
set
[!NOTE|label:OPTIONAL] no need if using
/usr/localas--prefixcheck
[!NOTE|label:references:]
get
or
or
get http_code for multiple urls
http_code for multiple urlsor
or
post
put
delete
authorization
content type
others
ssl
ignore invalid and self-signed SSL certificate errors in Curl
convert
get resource content by url
save url content to a file
download multiple files at once
check page http headers
force curl to use http/2 protocol
do follow redirects
use proxy server
provide additional http headers with request
send data to the server
change the user-agent string
send cookies to website
references
-O
Download the file and save it under the original name
curl -O [URL]
-o
Download the file and save it with a different name
curl -o [file name] [URL]
-X
Specify the HTTP method to be used when sending the request
curl -X [method] [URL]
-I or -head
Print the title without the body of the document
curl -I [URL]
-d
Specify the data to send to the server
curl -d "key1=value1&key2=value2" [URL]
-k or -insecure
Ignore SSL Certificate Errors
curl -k [URL]
-u or --user
Specify the authentication data by passing a pair of login-password
curl -u [user:password] [URL]
-F
Submit form data as POST request
curl -F @field_name=@path/to/myFile
--cookie
Send HTTP cookies
curl --cookie "Name=Value" [URL]
-x or --proxy
Use a proxy server to upload files
curl -x "[protocol://][host][:port]" [URL] [options]
--limit-rate
Limit the download speed
curl --limit-rate [speed] -O [URL]
-L or --location
Follow Curl redirect using HTTP Location header
curl -L [URL]
-v
Makes Curl verbose
curl -v [URL]
-m or --max-time
Set a limit in seconds for the entire operation
curl -m [SECONDS] [URL]
--connect-timeout
Set a limit in seconds for a connection request
curl --connect-timeout [SECONDS] [URL]
-T
Transfers the specified local file to a remote URL
curl -T [file name] [URL]
-H or --header
Add additional HTTP request header
curl -H "X-Header: value" [URL]
-D
Save the HTTP headers that the site sends back
curl -D [URL]
-A or --user-agent
Set User-Agent string
curl -A "value" [URL]
-C
Resume an interrupted or intentionally stopped download
curl -C [OFFSET] -O [URL]
write-out
Lookup time (time_namelookup)
The time, in seconds, it took from the start until the name resolving was completed
Connect time (time_connect)
The time, in seconds, it took from the start until the TCP connect to the remote host was completed
PreXfer time (time_pretransfer)
The time, in seconds, it took from the start until the file transfer was just about to begin. This includes all βpre-transferβ commands and negotiations that are specific to the particular protocol(s) involved
StartXfer time (time_starttransfer)
The time, in seconds, it took from the start until the first byte was just about to be transferred. This includes βtime_pretransferβ and also the time the server needed to calculate the result
AppCon time (time_appconnect)
The time, in seconds, it took from the start until the SSL/SSH/etc connect/handshake to the remote host was completed (Added in 7.19.0)
Redirect time (time_redirect)
The time, in seconds, it took for all redirection steps include name lookup, connect, pretransfer and transfer before the final transaction was started. βtime_redirectβ shows the complete execution time for multiple redirections. (Added in 7.12.3)
Last updated
Was this helpful?