Ad space (banner)
🖥️Linux Lessons
Lesson 37 / 61

Making a Request to a URL with curl

curl is for when "I want to actually send a request to a website or API to verify it works." curl sends an HTTP request to the given URL and displays the response.

Use it in the form curl URL. To send a POST request, combine it with -X POST; to add a header, combine it with the -H option, and so on.

Running curl https://example.com/api/status sends a request to that URL, and the server's response (JSON, HTML, or otherwise) is displayed directly on screen.

A common early mistake is misreading a correctly-returned response as "it's not working" just because it has no line breaks and looks like a mess. Piping it through something like | jq makes it much more readable.

In real work, this is used across development and operations alike — confirming API connectivity, test-sending a webhook, running a quick health check, and more.

Linux
Try it (type this into the pseudo terminal)
curl https://example.com/api/status

🧑‍💻 You can type this command into the Linux pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)