How to Add a Header to a curl Request
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]
.
I remember the early days of JavaScript where you needed a simple function for just about everything because the browser vendors implemented features differently, and not just edge features, basic features, like addEventListener
and attachEvent
. Times have changed but there are still a few functions each developer should...
Before we get started, it's worth me spending a brief moment introducing myself to you. My name is Mark (or @integralist if Twitter happens to be your communication tool of choice) and I currently work for BBC News in London England as a principal engineer/tech...
One of the great parts of MooTools is that the library itself allows for maximum flexibility within its provided classes. You can see evidence of this in the "Class" class' implement method. Using the implement method, you can add your own methods to...
Warning: The demo for this post may brick your browser.
A while back I posted a MooTools plugin called dwProtector that aimed to make image theft more difficult -- NOT PREVENT IT COMPLETELY -- but make it more difficult for the rookie to average user...