How do I properly use 'curl add header' to include custom headers in my requests?

16 Replies, 1498 Views

Hey everyone,

So, I’ve been messing around with curl add header for a while now, and I’m kinda stuck. I need to include some custom headers in my requests, but I’m not sure if I’m doing it right.

I’ve been using something like:
`curl -H "Authorization: Bearer mytoken" https://example.com`
But sometimes it feels like the headers aren’t being sent properly? Or maybe I’m just paranoid lol.

Also, what if I need to add multiple headers? Do I just stack the -H flags like:
`curl -H "Header1: value1" -H "Header2: value2" https://example.com`
Or is there a better way?

Any tips or examples on how to properly use curl add header would be super helpful! Thanks in advance, y’all.

P.S. Sorry if this is a noob question, still getting the hang of this stuff. 😅

Messages In This Thread
How do I properly use 'curl add header' to include custom headers in my requests? - by - 17-10-2024, 01:31 AM



Users browsing this thread: 1 Guest(s)