How to Add a Header to a curl Request

Date:

Share post:

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].

Request Metrics real user monitoring
Request Metrics real user monitoring
Request Metrics real user monitoring
  • Interview with a Pornhub Web Developer
  • An Interview with Eric Meyer

    An Interview with Eric Meyer

    Your early CSS books were instrumental in pushing my love for front end technologies. What was it about CSS that you fell in love with and drove you to write about it? At first blush, it was the simplicity of it as compared to the table-and-spacer…

  • Dijit’s TabContainer Layout:  Easy Tabbed Content
  • Printing MooTools Accordion Items

    Printing MooTools Accordion Items

    Sometimes we’re presented with unforeseen problems when it comes to our JavaScript effects. In this case, I’m talking about printing jQuery and MooTools accordions. Each “closed” accordion content element has its height set to 0 which means it will be hidden when the…


Source link
spot_img

Related articles

A CISO playbook – Sophos News

The North Korean worker scheme has expanded into a global threat. Although it originally focused on U.S. technology...

RAID vs Non – RAID Storage: Difference and Comparison

The hidden cost of selecting the incorrect storage configuration can be devastating, as an eye-catching statistic suggests that...

Mobile Applications for Event Lead Capture

1. Introduction to Event Lead Capture Digitalization in Event Lead Capture Corporate events, trade shows, and conferences represent unique opportunities...

Jack Dorsey funds diVine, a Vine reboot that includes Vine’s video archive

As generative AI content starts to fill our social apps, a project to bring back Vine’s six-second looping...