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
  • How I Stopped WordPress Comment Spam

    How I Stopped WordPress Comment Spam

    I love almost every part of being a tech blogger:  learning, preaching, bantering, researching.  The one part about blogging that I absolutely loathe:  dealing with SPAM comments.  For the past two years, my blog has registered 8,000+ SPAM comments per day.  PER DAY.  Bloating my database…

  • Create a CSS Flipping Animation

    Create a CSS Flipping Animation

    CSS animations are a lot of fun; the beauty of them is that through many simple properties, you can create anything from an elegant fade in to a WTF-Pixar-would-be-proud effect. One CSS effect somewhere in between is the CSS flip effect, whereby there’s…

  • Digg-Style Dynamic Share Widget Using MooTools

    Digg-Style Dynamic Share Widget Using MooTools

    I’ve always seen Digg as a very progressive website. Digg uses experimental, ajaxified methods for comments and mission-critical functions. One nice touch Digg has added to their website is their hover share widget. Here’s how to implement that functionality on your site…

  • Flext: MooTools Auto-Growing Textrea Plugin

Source link
spot_img

Related articles

A new version of Triada spreads embedded in the firmware of Android devices

Introduction Older versions of Android contained various vulnerabilities that allowed gaining root access to the device. Many malicious programs...

SemiAccurate Acquires AnandTech – Semiaccurate

Welcome to the new SemiAnandCo Today SemiAccurate is announcing it’s largest expansion to date with the acquisition of AnandTech. With...

Which is the best option?

Checklist: How to choose the best access technology for your event ✅ Evaluate your available budget If you have limited...