Sunday, September 8, 2024
HomeWeb developmentTips on how to Add a Header to a curl Request

Tips on how to Add a Header to a curl Request


curl is a kind of nice utilities that is been round seemingly perpetually and has limitless use instances. Today I discover myself utilizing curl to batch obtain information and take a look at 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 may add a number of headers with a number of -H makes use of. Header format is normally [key]: [value].

  • Create Namespaced Classes with MooTools

    MooTools has at all times gotten a little bit of grief for not inherently utilizing and standardizing namespaced-based JavaScript lessons just like the Dojo Toolkit does.  Many builders create their lessons as globals which is usually frowned up.  I largely disagree with that stance, however every to their very own.  In any occasion…

  • Serving Fonts from CDN

    For optimum efficiency, everyone knows we should put our belongings on CDN (one other area).  Together with these belongings are customized net fonts.  Sadly customized net fonts by way of CDN (or any cross-domain font request) do not work in Firefox or Web Explorer (appropriately so, by spec) although…


RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments