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
  • 5 Ways that CSS and JavaScript Interact That You May Not Know About
  • Animating CSS3 Transforms with MooTools Fx
  • Degradable SELECT onChange

    Degradable SELECT onChange

    Whenever I go to Google Analytics I notice a slight flicker in the dropdown list area. I see a button appear for the shortest amount of time and the poof! Gone. What that tells me is that Google is making their site function…

  • Xbox Live Gamer API

    Xbox Live Gamer API

    My sharpshooter status aside, I’ve always been surprised upset that Microsoft has never provided an API for the vast amount of information about users, the games they play, and statistics within the games. Namely, I’d like to publicly shame every n00b I’ve baptized with my…


Source link
spot_img

Related articles

LoD – Darknet Diaries

Full Transcript The Legion of Doom (LoD) wasn’t just a “hacker group”, it captured the...

Edifier’s Funky Portable ES300 Wireless Speaker

60W RMS From A 4″ Bass Driver And Dual 1.25″ Silk Dome Tweeters Portable speakers are a confusing product,...

Corporate Event Registration Software: SSO, Approvals, Budget Controls

If you run events for a large organization, registration is no longer just a form on a landing...

Future of AI in Car Wash App Development

The evolution of car wash apps has expanded beyond simplistic bookings and payments. Today, car wash app users...