CURL

sathishpy1808

sathishkumar balachandran

Posted on July 9, 2023

CURL

CURL

Command Line Utility
Used to retreive a URL from WEB using HTTP or HTTPS

Installation

sudo apt-get install curl

Image description

About Curl

Eg.,

curl https://www.onlinesbi.sbi/ --> It provides the complete HTML page of the website.

Image description

Now going to output the file from the curl command,

curl https://www.onlinesbi.sbi -o sbi.html

Image description

Common Option is : COOKIES

curl https://www.onlinesbi.sbi -c sbicookies.html

Image description
This will have cookie information ...
How we can pass the information back to the site using -b and -c ? TBD

Below one , also TBD

Image description

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 :

  1. File name should not have any '_' like sbi_html.html --> we are unable to execute these costume name.
  2. curl -h or man curl --> Library
💖 💪 🙅 🚩
sathishpy1808
sathishkumar balachandran

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