How to change the HTTP verb (Post-GET vice versa) during runtime using groovy script
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to change the HTTP verb (Post-GET vice versa) during runtime using groovy script
How to change the verb during runtime like Rest API definition will be post and using groovy script if i want to change to GET or any other verb..is it possible? Can any one please suggest/guide.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @apartamsetti .
I don't really see/understand the use case to do that... You want to: Given a certain condition execute either a POST or a GET?
Can't you then not define those POST & GET methods in your ReadyAPI "APIs" section and then in your test case perhaps use a script to execute "given condition X run test step "POST" else run test step "GET" "?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I echo the same thoughts as @JoostDG .
Here is groovy way to send the REST requests using this groovy-ws-lite library
https://github.com/jwagenleitner/groovy-wslite
Please explore.
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Actually i defined Post Endpoint in API's and in the test case if i want to modify the verb to GET using groovy script is it possible? This is my one of my test scenario. Not sure i think it may not be possible to change the defined verb.
Thank you for your reply..
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you definitely i will go explore it.
