Forum Discussion

Boguslaw's avatar
16 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

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    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