Skip to content

HTTP Header Manager

Configure the JMeter HTTP Header Manager configuration elements: properties, defaults, and practical usage notes for building reliable load tests.

Difficulty
intermediate
Guide type
reference
Estimated read time
1 min read
Last verified version
Verified JMeter 5.6

Part of the Configuration Elements category. Also documented in context in the full Component Reference.

TL;DR: the HTTP Header Manager sets custom HTTP headers (Authorization, Content-Type, custom API keys) on every request in its scope — the standard place to inject a bearer token or API key without repeating it on every sampler.

HTTP Header Manager

The Header Manager lets you add or override HTTP request headers.

JMeter now supports multiple Header Managers. The header entries are merged to form the list for the sampler. If an entry to be merged matches an existing header name, it replaces the previous entry. This allows one to set up a default set of headers, and apply adjustments to particular samplers. Note that an empty value for a header does not remove an existing header, it justs replace its value.

NameRequiredDescription
NameNoDescriptive name for this element that is shown in the tree.
Name (Header)No (You should have at least one, however)Name of the request header. Two common request headers you may want to experiment with are “User-Agent” and “Referer”.
ValueNo (You should have at least one, however)Request header value.
Add ButtonN/AAdd an entry to the header table.
Delete ButtonN/ADelete the currently selected table entry.
Load ButtonN/ALoad a previously saved header table and add the entries to the existing header table entries.
Save As ButtonN/ASave the current header table to a file.

Download this example. In this example, we created a Test Plan that tells JMeter to override the default “User-Agent” request header and use a particular Internet Explorer agent string instead. (see figures 12 and 13).

Figure 12 - Test Plan Figure 12 - Test Plan

Figure 13 - Header Manager Control Panel Figure 13 - Header Manager Control Panel

  • Scope it at the right level: a Header Manager on the Thread Group applies to every request underneath; one on a single sampler overrides just that request — duplicate/conflicting headers at different scopes is a common source of confusing behavior.
  • Content-Type set here can be silently overridden by JMeter itself for some body types (e.g. multipart) — if a header isn’t appearing as expected, check whether the sampler is auto-setting it.
  • For dynamic values (a token that changes per iteration), reference a variable in the header value (Bearer ${authToken}) rather than hardcoding it — see JWT, OAuth & SSO Authentication.
  • If requests return 401/403 only in JMeter, compare the actual sent headers (View Results Tree → Request tab) against a working browser request — see HTTP 401/403 after recording.
On this page