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

DOM-Based Extension Clickjacking Exposes Popular Password Managers to Credential and Data Theft

Aug 20, 2025Ravie LakshmananVulnerability / Browser Security Popular password manager plugins for web browsers have been found susceptible to...

Work Smart: Planning in Progress

As founder and CEO of Adrenaline Special Events, which produces 5K races and other events, Aaron Del Mar...