How can I fetch the value of a response header in postman and save it in a variable so that I can use it in the next request?
Example:
HeaderName: HeaderValue
AESKey: ndowijdw92n9992n
I need to fetch ndowijdw92n9992n
and send it to the next request.
There is more direct way to access AESKey
header:
const responseHeaderAESKey = pm.response.headers.get("AESKey");
pm.environment.set("AESKey", responseHeaderAESKey );
Now the environment variable set contains the AESKey and you can access it in any part of Postman request with {{AESKey}}
. So use it in the next request.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With