How Do I Properly Use 'curl add header' to Include Custom Headers in My Requests?

30 Replies, 2948 Views

Hey! You're on the right track with `curl add header`. For adding an auth token, your example is spot on: `curl -H "Authorization: Bearer mytoken"`.

If you need multiple headers, yep, just stack the `-H` flags like this:
```
curl -H "Header1: Value1" -H "Header2: Value2" https://example.com
```

Also, check out [ReqBin](https://reqbin.com/) for testing curl commands online. It’s super handy for debugging!

Messages In This Thread



Users browsing this thread: 1 Guest(s)