Memorize curl commands (programming)

I saw this curl cookbook and though it might be useful to memorize.

I typed the following at a DOS command line:

curl https://artofmemory.com/

I got:

[moderator edit: raw html removed for readability]
C:\WINDOWS\system32>

I think there might be something strange at line 232 and maybe line 1,009, but otherwise things look fine.

Thanks.

I almost forgot to ask - what is it?

curl is a tool for making web requests in the terminal or from other programs.

It can be used for testing URLs while building features or other programming tasks. If you use it like in your example, it will just return the raw HTML of a page.

Examples

This will give you the current position of the International Space Station:

curl http://api.open-notify.org/iss-now.json

(In the screenshot, I sent the output through a formatting tool called jq, but that isn’t necesary.)
image

Or you can programmatically get data about Star Wars characters like this (change the number for a different character):

curl https://swapi.co/api/people/1/

If you can run a command in the terminal, it can be used for automation. Here’s an example of using curl in a little shell script that finds the titles of all the movies that Darth Vader has appeared in.

[Sorry, I removed the raw HTML in your post, because it won’t display correctly in the forum.]

2 Likes

My guess is that curl is derived from ‘command url’. Dunno. Very useful command.

I plan to tackle git.

2 Likes