bmoreira2000
bmoreira2000

Reputation: 45

Extract response x-authorization-token

i'm trying to extract from response headers an x-authorization-token to a variable and pass to another http request, i'm new using jmeter.

Following online tutos, i have created an regular expression extractor do define a regular expression x-authorization-token:\s+(.+)

i want to pass x-authorization-token: foo/bar to another request

Regular Expression Extractor conf

Response headers example:

HTTP/1.1 201 Created
Content-Length: 0
Connection: keep-alive
Server-Timing: intid;desc=foo/bar
x-transaction-id: 34297420-432942-foo-bar
x-authorization-token: foo/bar
Date: Wed, 23 Jun 2021 22:54:24 GMT
X-Kong-Upstream-Latency: 2130
X-Kong-Proxy-Latency: 20
Via: kong/1.00

Upvotes: 0

Views: 816

Answers (1)

Dmitri T
Dmitri T

Reputation: 168002

Just add a HTTP Header Manager as a child of the "another http request" and configure it as follows:

enter image description here

HTTP Header Manager allows defining arbitrary HTTP Headers so you can pass your x-authorization-token (as well as other headers if needed) to any request in the HTTP Header Manager's scope

Demo:

enter image description here

More information: Using JMeter's HTTP Header Manager

Upvotes: 0

Related Questions