Menu

Post image 1
Post image 2
Post image 3
Post image 4
1 / 4
0

How to Add a Header to a curl Request

David Walsh Blog·David Walsh·about 1 month ago
#lu7RCtGg
#comments#curl#using#around#headers#header
Reading 0:00
15s threshold

curl is one of those great utilities that's been around seemingly forever and has endless use cases. These days I find myself using curl to batch download files and test APIs. Sometimes my testing leads me to using different HTTP headers in my requests. To add a header to a curl request, use the -H flag: curl -X 'GET' \ 'https://nft.api.cx.metamask.io/collections?chainId=1' \ -H 'accept: application/json' \ -H 'Version: 1' You can add multiple headers with multiple -H uses. Header format is usually [key]: [value] . Recent Features Conquering Impostor Syndrome Two years ago I documented my struggles with Imposter Syndrome and the response was immense.  I received messages of support and commiseration from new web developers, veteran engineers, and even persons of all experience levels in other professions.  I've even caught myself reading the post... Write Better JavaScript with Promises You've probably heard the talk around the water cooler about how promises are the future.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More