Linux 101 : the cURL tool
from a server using a URL.
The cURL tool support a lot of protocols (http, https, ftp,...).
When we ping a site and we receive a response that tells us the web server is up. But what if we wanted to know whether the website is up, then we use cURL:
The cURL HTTP methods:
We could use curl as we would a wget command to dwmload programs:
curl -O http://full/path/ to_the_programs
Testing a website:
When we ping a site and we receive a response that tells us the web server is up. But what if we wanted to know whether the website is up, then we use cURL:
The cURL HTTP methods:
- POST : Create data.
- GET : Read data.
- PUT : Update data.
- DELETE : Delete data.
We could use curl as we would a wget command to dwmload programs:
curl -O http://full/path/ to_the_programs
Example:
We can download a debian ISO image for example by going to the download site, and right clicking on the link to copy its address:
https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-10.7.0-amd64-netinst.iso
Using cURL to look inside servers:
We use the below command to look inside a nginx web server:
cURL and pages redirects:
If the page moves to another location, the "-L" option tells cURL to redirect us to the new location.
Verbose output from cURL:
cURL errors (not allowed operations):
We try a POST method on a server but we discover that it does not allow that operation:
Comments