API and browser load tests often depend on request metadata as much as the URL or payload. In JMeter, the HTTP Header Manager supplies those request headers so HTTP samplers can send JSON content types, accepted media types, authorization values, or application-specific flags at the right scope.
The manager is a configuration element rather than a request sampler. Place it under a Thread Group when several child HTTP samplers need the same headers, or place it directly under one HTTP Request sampler when only that request should receive them.
Multiple HTTP Header Manager elements can apply to the same sampler. JMeter merges their rows for the outgoing request, and a later row with the same header name replaces the earlier value, which makes a shared default plus a sampler-specific override safer than copying every row into every request.
Select the Thread Group for shared API headers. Select one HTTP Request sampler for request-specific headers.
Name: Content-Type Value: application/json Name: Accept Value: application/json Name: X-Test-Scenario Value: checkout-smoke
Use the exact header names expected by the target application. Header names are case-insensitive on the wire, but consistent casing keeps the test plan easier to review.
Name: Authorization
Value: Bearer ${api_token}
Do not save live bearer tokens, session cookies, or private API keys in a shared .jmx file. Load them from a variable source or command-line property when the plan runs.
Related: How to add a bearer token header in JMeter
If two applicable header managers define the same header name, the matching row replaces the previous value during the merge. An empty value still sends the header with an empty value; it does not remove the earlier row.
header-manager-add.jmx
$ jmeter -n -t header-manager-add.jmx -l header-manager-results.jtl Creating summariser <summary> Created the tree successfully using header-manager-add.jmx ##### snipped ##### Waiting for possible Shutdown/StopTestNow/HeapDump/ThreadDump message on port 4445 summary = 1 in 00:00:00 = 11.5/s Avg: 16 Min: 16 Max: 16 Err: 0 (0.00%) Tidying up ... ... end of run
$ cat header-manager-results.jtl timeStamp,elapsed,label,responseCode,responseMessage,threadName,dataType,success,failureMessage,bytes,sentBytes,grpThreads,allThreads,URL,Latency,IdleTime,Connect 1782776110247,16,POST /checkout,200,OK,Checkout API smoke users 1-1,text,true,,107,254,1,1,https://api.example.net/checkout,13,0,11
$ cat header-echo-server.log method=POST path=/checkout content_type=application/json accept=application/json x_test_scenario=checkout-smoke status=200