Your first curl
Send a real HTTP request from the terminal
⏱ Est. ~5 min
01 · Read
curl is your walkie-talkie for talking to the network.
You speak (send a request), the server replies (sends a response). No browser, no app, no abstractions — just you and the raw conversation.
Every engineer uses curl to test APIs, debug requests, and check whether a server is still alive. It's one of the most useful tools you'll ever learn.
Key points
- curl <url> sends a GET request and prints the response body
- curl -i <url> prints the response headers above the body
- curl -s <url> is silent mode — hides the progress bar
- For API endpoints, the response body is usually JSON
02 · Terminal exercise
Let's send your first HTTP request. You're about to talk to a server directly — no browser needed.
(This section is interactive — please enable JavaScript.)
03 · Quiz
What does curl do?
- Compiles code
- Creates files
- Sends HTTP requests from the command line
- Manages packages
04 · Fill in the blank
To send a GET request with curl, type curl _____.
05 · Terminal exercise
Now let's see the full response — including headers. Add the -i flag (i = include headers).
(This section is interactive — please enable JavaScript.)
06 · Quiz
You run curl https://api.example.com/users and get JSON data back. What kind of HTTP request did curl send?
07 · Fill in the blank
To include response headers in curl's output, add the _____ flag.
Other lessons in this chapter
⚠ The full interactive experience needs JavaScript. Please enable it and reload.
※ This is an independent Traditional Chinese teaching project — not an official Anthropic product. Claude™ is a trademark of Anthropic, PBC.