Skip to content
Tech Bits
All articles

Why use a curl command?

curl is a tool for moving data to or from a URL. You run it in a terminal, a window that accepts written commands.

Your signup list is blank. Is the service returning no data, or is your app failing to display it? Your assistant suggests a curl command to test the request on its own:

Terminal
curl -i https://api.example.com/signups

curl runs the tool. The URL is the endpoint to contact. This command uses GET by default, asking to retrieve data. -i includes the response headers, so you can see the status as well as the returned data.

If the reply contains Alex’s signup, you’ve learned that this request can retrieve it. You can then investigate how your app makes the request and displays the result. curl helps you test one part at a time.

curl -i https://api.example.com/signups

The response will appear here.

Two ways to make the same request. A simulation using a fictional API.

Read a copied command’s destination, action, and data before running it. Some requests change real data. This example uses a fictional address; the interactive demo stays on this page.

Sources

Reviewed