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 with every request. Right now I am defining these headers on each resource, but it would be helpful if I could define these at a higher level (perhaps on the service, environment, or project?)Solved7.9KViews0likes5Commentsadd request header to all calls
I am trying to find a better solution for adding a header to all calls. This questions was already asked here and earlier here. The proposed solution for both of these was to add a RequestFilter.filterRequest event: def headers = request.requestHeaders headers.put( "X-test", "test" ) request.requestHeaders = headers This solution has two problems: This just keeps adding the same header for each call; meaning if you make the call say three times, you have three of these headers. I tried adding a RequestFilter.afterRequest event with request.requestHeaders.clear() , but that did not work. I have multiple services in my project, and I need to add this header for all requests of only one of my services. Any advice would be appreciated.Solved4.4KViews0likes7Comments