03 / API & Auth / http-header-generator
HTTP Header Generator
Build HTTP request headers for API testing.
How to use
- 01Start from the default Content-Type, Authorization and Accept rows, or press Clear to remove them all.
- 02Add headers with Add header, pick a common name from the Header preset list and press Add preset header, or use the Bearer Token, Basic Auth, API Key and Content-Type quick buttons.
- 03Edit any header name or value inline, and remove a row with its trash button. Rows with an empty name are left out of the output.
- 04Switch the output format between HTTP, cURL and fetch, then press Copy.
What is this tool?
A header builder for API testing. It assembles request headers from editable rows and outputs them as raw HTTP header lines, cURL -H flags or a fetch() headers object, flagging duplicate header names along the way. The authorization buttons insert placeholder values for you to replace, such as Bearer <token>. Everything runs locally in your browser.
Output formats: raw HTTP, cURL -H flags and fetch()
HTTP output prints one Name: value line per header, the way headers appear in a raw request or in tools like the VS Code REST Client. cURL output wraps each header in single quotes after -H, one per line with a trailing backslash, ready to paste after a curl command; any single quote inside a value is escaped as '\'' for bash and zsh. fetch output produces a fetch(url, { headers: { ... } }) snippet with the headers as a JSON object, where url is a variable you supply.
For example, Content-Type: application/json in cURL format becomes -H 'Content-Type: application/json'.
Common request headers and duplicate names
The quick buttons cover the headers APIs ask for most. Content-Type describes the body you send: application/json, application/x-www-form-urlencoded, multipart/form-data, text/plain or application/xml. Accept states what you want back. Authorization carries credentials, as Bearer <token>, Basic <base64(user:pass)> or ApiKey <key>; replace the placeholder with a real value, for example from the Basic Auth or Bearer Token header tools. Many APIs expect an API key in a custom header such as X-API-Key instead, which is in the preset list along with User-Agent and Cache-Control.
Header names are case-insensitive, so content-type and Content-Type are the same header. The tool flags duplicates regardless of case, because servers handle them inconsistently: some merge the values, others keep only the last one. In fetch output, only the last value of a duplicate name survives.
Sending an API key: header or query string
APIs that use static keys usually expect them in a header, either a custom one such as X-API-Key: <key> or in Authorization with a scheme like ApiKey <key>; the exact name and format come from the provider's documentation. Use the X-API-Key preset or the API Key button and adjust the name or prefix to match.
Headers are preferable to query parameters for secrets because URLs tend to end up in server logs, browser history and Referer headers, while request headers usually do not.
Common use cases
- Preparing headers for a new API integration
- Converting a header set into cURL -H flags
- Generating a fetch() headers object for frontend code
- Documenting required headers for an endpoint
- Spotting a duplicated Content-Type or Authorization header
FAQ
Are header values validated?
Names and values are passed through as typed. The only check is for duplicate names, which are flagged regardless of letter case.
Can I output cURL flags?
Yes. Switch the output format to cURL to get one single-quoted -H flag per header.
Is anything uploaded?
No. Headers are built locally in your browser.
Can I include an auth header?
Yes. The Bearer Token, Basic Auth and API Key buttons add an Authorization row with a placeholder value that you replace with your real credential.
Are HTTP header names case-sensitive?
No. HTTP header names are case-insensitive, which is why the duplicate check ignores case. Header values can be case-sensitive.
What happens if I send the same header twice?
It depends on the client and server. Some combine the values into a comma-separated list and others keep only the last one, so it is safest to send each header once.