Skip to main content

Command Palette

Search for a command to run...

Getting Started with cURL

Published
2 min read
Getting Started with cURL
S

I am MERN STACK Web Developer.I am Student of BCA.

What is cURl?

curls ka full name hota hai client URL, jo ki ek command line tool hai.jiska use developer server per data send karna aur server se response ke liye use karta hai.

Why programmers need cURL?

ek programmer ke liye dekha jaaye toh mostly, server ke saath data ko transfer ke liye use kiya jaata hai.jaise ki :

  • API Testing & Debugging

    • API Request : iske under dekha jaaye toh rest api ko test karne ke liye use hota hai like GET, POST,PUT,DELETE,PUT and PATCH method.

    • API Response : iske under server se aane wale data ko terminal per dikhta hai jisse api ko check karna easy ho jata hai.

  • File Transfer

    • isko dekha jaaye toh file ko server per upload karna yaa server se downlod karne ke liye bhi use hota hai.
  • Web scrapping

    • iska use kisi bhi site se uska raw html download karna iske liye bhi curl ka use kiya jaata hai.

Making your first request using cURL?

first command for curl https://chaicode.com

Understanding Request and Response

Agar hm server ke ssath communication dekhna chate hai toh basically kya hota hai client(user) server per request send karta hai fir server se response client ke paas hota hai iss tarike se server per comunication hota hai.

lets explain, iske under basically kya ho raha hai curl yeah ek comand-line HTTP client hai. https://chaicode.com URL jaha per hamne requesting ki hai. agar dekha jaaye toh iske under ho kya raha hai jaise ki hamne GET method call kiya host(https://chaicode.com) per yeah request gya server per aur server se apne ko response mila html ko content jo ki yeah exists karta hai.