CURL
sathishkumar balachandran
Posted on July 9, 2023
CURL
Command Line Utility
Used to retreive a URL from WEB using HTTP or HTTPS
Installation
sudo apt-get install curl
About Curl
Eg.,
curl https://www.onlinesbi.sbi/ --> It provides the complete HTML page of the website.
Now going to output the file from the curl command,
curl https://www.onlinesbi.sbi -o sbi.html
Common Option is : COOKIES
curl https://www.onlinesbi.sbi -c sbicookies.html
This will have cookie information ...
How we can pass the information back to the site using -b and -c ? TBD
Below one , also TBD
POST REQUEST :
curl -d "output=json"
How to check the certificate ?
curl -k --> Use this -k which is insecure to bypass the HTTPS certificate.
How to pass username and password to a URL ?
curl -u name:password
CUSTOM HEADER :
curl -H "Content-Type: application/json"
Important Notes :
- File name should not have any '_' like sbi_html.html --> we are unable to execute these costume name.
- curl -h or man curl --> Library
Posted on July 9, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
November 29, 2024