Skip to main content

Command Palette

Search for a command to run...

Getting Started with cURL

Updated
2 min read
A
CS student and full-stack developer from Pakistan. Building with JavaScript, TypeScript, React, and Node.js. Currently in ChaiCode's Web Dev Cohort 2026.

cURL is exactly like a Postman but for terminal/command line. When we want to send letter to someone, we give letter to postman and postman deliver it. Similarly cURL is a tool which send request to server from terminal and get`s response back.

cURL is a command-line tool that help us to talk with servers and APIs directly using terminal without opening any browser.

Why Programmers Need cURL ?

cURL helps programmers to easily access websites and test APIs without opening browsers again and again. Using cURL, programers test APIs in the backend and can get whole HTML code without inspecting the browser.


Making your first request using cURL :

Step 1 : Check if cURL is installed on Windows

cURL comes pre-installed with Windows 10 and later versions (PowerShell).

Open PowerShell or Command Prompt and type:

curl --version

If you see a version number then it`s already installed , or you can download it from curl.se/download.

Step 2 : Make Your First Request

Open PowerShell and run this command:

curl http://www.google.com

What will happen?

  • cURL will send a GET request to Google server

  • Server will send data packets

  • You`ll recieve google homepage HTML code


Common cURL Mistakes to avoid as a Beginner :

  1. Forget to Include the Address

    Don`t write like this :

     curl               # this is not correct, because it don`t have any URL.
    

    Always include a URL because it is exactly like you are giving an address:

     curl http://google.com        # It is Correct because it have url.
    
  2. Use of HTTP and HTTPS

    i) HTTP is less common now , use it when the website supports non secure connection.

      curl http://google.com         # Non-secure connection
    

    ii) Use HTTPS when the website supports a secure connections (mostly in modern websites).

      curl https://google.com       # Secure connection with encryption
    
  3. Writing Incomplete Command :

    Don`t write incomplete or wrong command,

     curl google.com                 # sometimes, this command can be wrong
    

    This works on many setups , it`s clearer and safer to write:

     curl http://google.com       # this is correct command
    

More from this blog

A

Abdul Rahman

13 posts

Writing about web development as I learn — projects, mistakes, and things worth sharing. CS student. ChaiCode Web Dev Cohort 2026.