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
  • Animating CSS3 Transforms with MooTools Fx
  • fetch API

    fetch API

    One of the worst kept secrets about AJAX on the web is that the underlying API for it, XMLHttpRequest, wasn’t really made for what we’ve been using it for.  We’ve done well to create elegant APIs around XHR but we know we can do better.  Our effort to…

  • Add Site Screenshots for External Links Using MooTools Tooltips

    Add Site Screenshots for External Links Using MooTools Tooltips

    Before you send your user to an unknown external website, why not provide them a screenshot of the site via a tooltip so they may preview the upcoming page? Here’s how you can do just that using MooTools. The MooTools JavaScript The first step is to grab…

  • MooTools Zebra Table Plugin

    MooTools Zebra Table Plugin

    I released my first MooTools class over a year ago. It was a really minimalistic approach to zebra tables and a great first class to write. I took some time to update and improve the class. The XHTML You may have as many tables as…


Source link
spot_img

Related articles

Weekly Update 488

It's the discussion about the reaction of some people in the UK regarding their impending social media ban...

Our favorite CPU, the Ryzen 7 9800X3D just got a decent price cut

Despite AMD's recent launch, this is stil the best gaming CPU to buy, and now it...

PivotPrime Delivers Greater Visibility and Control of Project

With its start in the 1970s in Racine, Wisconsin, as a small travel agency with four employees, Meetings...

Case Insensitive CSS Attribute Selector

CSS selectors never cease to amaze me in how powerful they can be in matching complex patterns. ...