June 20, 2026 · by Meegrow Labs

What Is an HTTP Header? Show Your ID at the Gate

You typed a curl command, hit enter, and the API said no. Not “page not found” — just a flat refusal. The page is real, your spelling is fine, but the server won’t talk to you. The thing it’s quietly waiting for is a header.

An HTTP header is a small piece of extra information your request carries — like a name-and-value ID card — that tells the server who you are or what you want, so it knows whether and how to answer you.

What is an HTTP header, really?

A plain request just asks for a page. But sometimes the server needs to know more. Who are you? What format do you want back? That extra info travels in headers.

Think of an office gate. The guard won’t let you in on your word alone. You show your ID card, and the gate opens. A header is that ID card. It rides along with your request, quietly, and the server reads it before answering.

Each header is simply a name and a value — nothing more. The name says what kind of information this is; the value is the information itself.

How do I send a header with curl?

You add one with curl using -H (dash, capital H). That flag means “add a header.” After it, you write the header as Name: Value inside quotes, then the web address.

curl -H "Auth: token" https://example.com

Let’s break that apart:

  • -H tells curl to add a header.
  • Auth is the name — the kind of header.
  • token is the value — the actual ID, in this case proving who you are.

The server checks the header and lets you through. If you’ve worked through the free Zero to AI Hero course, this is the same one-line curl you already know — you’re just attaching an ID to it.

Why does this matter?

Because most real APIs won’t reply without a header. No header, no entry. The right header opens the gate; a missing one gets you a polite “no.”

This connects directly to the status codes you saw earlier: many APIs answer a header-less request with a 401 instead of a 200. Once you understand headers, that 401 stops being a mystery and becomes a checklist item — “did I show my ID?”

Can I send more than one header?

Yes. Real requests often carry several ID cards at once — one to prove who you are, another to say what format you want back. You just repeat -H for each:

curl -H "Auth: token" -H "Accept: application/json" https://example.com

Here the first header proves identity, and the second tells the server, “please answer in JSON.” The server reads both before it replies. You’ll use this pattern constantly once you start calling live APIs.

Key takeaways

  • An HTTP header is extra information your request carries — like an ID card at a gate.
  • Every header is just a name and a value, such as Auth: token.
  • Send one with curl using -H "Name: Value" before the address.
  • Most real APIs won’t reply without the right header — no header, no entry.
  • You can stack several headers by repeating -H.

Now you can show your ID at the gate. Next up: sending data with POST, so you’re not just asking for pages — you’re handing the server something to save. Keep the streak going.


🚀 Take the full free course: Zero to AI Hero — learn to build with AI from scratch. New lessons daily, in Hindi & English.

Meegrow Labs

We help India go from zero to AI hero — learn to use & build with AI from scratch, in Hindi & English. Start the free course →

Want to actually learn this?

151 free 2-minute lessons — from "what's a file?" to building with AI.

▶ Start the free course