How do I use curl to make a request? Need help with the syntax! or What's the correct way to curl mak

18 Replies, 1384 Views

Bro, just use Postman to build the request first, then copy as curl.

But if you insist on raw curl make request:

```
curl -X POST "https://example.com/api" \
-H "Accept: application/json" \
-H "X-API-Key: yourkey" \
-d '{"param":"value"}'
```

`-d` is for raw data, `--data-urlencode` URL-encodes it. Docs suck, but trial and error works.

Messages In This Thread



Users browsing this thread: 1 Guest(s)