# Getting Started with cURL

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.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1769166787285/ba7f6a11-ca2c-47d4-93a4-73e37405a4a9.png align="center")

## 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:

```powershell
curl --version
```

If you see a version number then it\`s already installed , or you can download it from [**curl.se/download**](https://curl.se/download).

***Step 2 : Make Your First Request***

Open PowerShell and run this command:

```powershell
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 :

### **Forget to Include the Address**

Don\`t write like this :

```powershell
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:

```powershell
curl http://google.com        # It is Correct because it have url.
```

### **Use of HTTP and HTTPS**

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

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

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

```powershell
 curl https://google.com       # Secure connection with encryption
```

### Writing Incomplete Command :

Don\`t write incomplete or wrong command,

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

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

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

* * *

You can find more of my work at [abdulrdeveloper.me](https://abdulrdeveloper.me)  
Read more posts at [blog.abdulrdeveloper.me](https://blog.abdulrdeveloper.me)
