dlumpkin
9 years agoNew Contributor
Default headers for all resources
Is there any way in ReadAPI 1.5 and SoapUI NG to create a default header that will be used across all resources? We have a standard set of headers (such as X-Requested-By) that need to be included wi...
- 9 years agoYou can use Events - Before run of a test step.
- 9 years ago
Thanks, I ended up creating a RequestFilter.filterRequest event handler with a script like the following:
def headers = request.requestHeaders
headers["X-Requested-By"] = ["test"] request.requestHeaders = headersUpdate: Be careful to set headers to a new List rather than using the add method because this actually modifies the request definition rather than the outgoing request instance. The add method will keep adding a new copy of the header on every run