Forum Discussion

Boguslaw's avatar
17 years ago

Rest respond Header access from Groovy script R

Hi

I have a problem with getting a header content form a Rest respond. I tried a suggested approach in soapui user guide assert messageExchange.responseHeaders["Location"] != null
and it works with Script Assertion but I would like to obtain header content form Groovy script in soapui. Any idea how to do it

Bugii

1 Reply

  • Hi,

    sure, you can access the responseHeaders from a script with

    def header  = testRunner.testCase.testSteps["REST Request"].testRequest.response.responseHeaders["Location"]

    regards,

    /Ole
    eviware.com