You can use Groovy scripts to modify headers of requests, as well as get headers from responses. This topic describes how to use a Groovy script to work with HTTP headers.
You can run this script as the RequestFilter.filterRequest
event handler.
The following code demonstrates how to add a custom HTTP header to requests from within the event handler:
As a Groovy Script test step.
The following code demonstrates how to save a response header value to a test case property:
You can run this script as the RequestFilter.filterRequest
event handler.
The following code demonstrates how to add an authentication header to requests from the event handler: