Forum Discussion

MikeDally's avatar
MikeDally
Contributor
9 years ago
Solved

How do I extract REST query parameters and access them via a Groovy Script

Hi guys,

 

I have the following REST request, whereby I am submitting 2 query values. I want to use these values in a Groovy script which will be used to connect to a database later in my tests.

 

GET http://<host>/<path>?postcode=LS1%2000EY&ProductList=10006541

I basically want to extract the postcode and ProductList values.

 

Any idea on how to do this? I've not found much online around this.

 

Many thanks,

 

Mike

 

  • Update: I was able to do this simply by entering:

     

    context.expand(${postcode})
    context.expand(${ProductList})

1 Reply

  • Update: I was able to do this simply by entering:

     

    context.expand(${postcode})
    context.expand(${ProductList})