Sunday, August 4, 2024
HomeSoftware DevelopmentThe right way to Add a Header to a curl Request

The right way 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. Lately 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’ll be able to add a number of headers with a number of -H makes use of. Header format is normally [key]: [value].

  • How to Create a RetroPie on Raspberry Pi – Graphical Guide

    In the present day we get to play superb video games on our tremendous powered sport consoles, PCs, VR headsets, and even cell gadgets.  Whereas I take pleasure in taking part in new video games lately, I do lengthy for the retro gaming methods I had after I was a child: the unique Nintendo…

  • Conquering Impostor Syndrome

    Two years in the past I documented my struggles with Imposter Syndrome and the response was immense.  I acquired messages of assist and commiseration from new internet builders, veteran engineers, and even individuals of all expertise ranges in different professions.  I’ve even caught myself studying the submit…

  • Growl-Style Notifications Using MooTools Roar
  • Full Width Textareas

    Working with textarea widths may be painful if you’d like the textarea to span 100% width.  Why painful?  As a result of if the textarea’s containing factor has padding, your "width:100%" textarea will doubtless stretch exterior of the mother or father container — a irritating prospect to say the least.  Fortunately…



Supply hyperlink
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments