Forum Discussion

richie's avatar
richie
Community Hero
7 years ago

Capture header value from POST to transfer to subsequent GET's header?

Hi,   I recently posted a query (see link) about scraping the header attributes in a POST's response to transfer onto a subsequent GET request and the query was successfully answered....so thankyou...
  • richie's avatar
    richie
    7 years ago

    I'm an idiot.

     

    To reiterate - in my test case I have a POST which generates a response header value that I needed to pass onto a subsequent GETs request header

     

    I didn't know about the header parameter you can specify when you create the service/resource/method/request.  I knew you could add query, matrix, and template parms - but not header parms - this is exactly what I needed.

     

    All I needed to do was re-create the subsequent GET request ensuring to specify it uses a header parameter.

     

    The groovyscript extracts the header value from the previous requests response and populates the properties file.  The Property Transfer handles the transfer.  Then via the subsequent request in the test that needs the header value - just click on the ellipsis button on the value field to 'GetData' from the Properties file!

     

    Sorted!

     

    Thanks,

     

    richie