Methods to Add a Header to a curl Request


curl is a kind of nice utilities that is been round seemingly endlessly and has infinite use instances. Nowadays I discover myself utilizing curl to batch obtain information and check APIs. Typically my testing leads me to utilizing totally different HTTP headers in my requests.

So as 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 'settle for: software/json' 
 -H 'Model: 1'

You possibly can add a number of headers with a number of -H makes use of. Header format is normally [key]: [value].

  • Being a Dev Dad

    I get requested a great deal of questions each day however I am at all times stunned that they are hardly ever questions on code and even tech — lots of the questions I get are extra about non-dev stuff like what my workplace is like, what software program I take advantage of, and oftentimes…

  • How I Stopped WordPress Comment Spam

    I really like virtually each a part of being a tech blogger:  studying, preaching, bantering, researching.  The one half about running a blog that I completely detest:  coping with SPAM feedback.  For the previous two years, my weblog has registered 8,000+ SPAM feedback per day.  PER DAY.  Bloating my database…

  • CSS Transforms

    CSS has turn into increasingly more highly effective over the previous few years and CSS transforms are a major instance. CSS transforms enable for stylish, highly effective transformations of HTML parts.  A number of transformations could be utilized to a given component and transforms may even be animated…

  • MooTools Documentation Search Favelet

    I’ll share one thing with you that may blow your thoughts: I haven’t got the MooTools documentation memorized. I simply do not. I go to the MooTools docs incessantly to determine the order of parameters of Extra lessons and the way greatest to make use of…


Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles