How do I use curl to make a request from the command line? or What's the best way to make a request w

24 Replies, 1703 Views

Here’s a quick breakdown:

- `curl [URL]` → GET request (default)
- `-X` → Specify method (GET, POST, etc.)
- `-H` → Add headers (like `-H "Authorization: Bearer token"`)
- `-d` → Send data (for POST/PUT)

Example for a GET:
```
curl https://jsonplaceholder.typicode.com/posts/1
```

Messages In This Thread



Users browsing this thread: 1 Guest(s)