A primer on cURL
cURL
is a powerful utility that supports protocols, such as HTTP, HTTPS, and FTP. It supports many features including POST
, cookies, authentication, downloading partial files from a specified offset, referer, user agent string, extra headers, limit speed, maximum file size, progress bar, and so on. cURL is very useful when we play around with automating a web page usage sequence, and to retrieve data. This recipe is a list of the most important features of cURL.
Getting ready
cURL mostly doesn't come with any Linux distros; you may have to install it by using the package manager. By default, distributions ship with wget
.
cURL usually dumps the downloaded files to stdout
, and progress information to stderr
. To avoid the progress information from being shown, we use the --silent
option.
How to do itβ¦
The curl
command can be used to perform different activities, such as downloading, sending different HTTP requests, and specifying HTTP headers. Let's see how we can perform different...