Forum Discussion

apartamsetti's avatar
apartamsetti
New Contributor
2 years ago

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.

4 Replies

  • JoostDG's avatar
    JoostDG
    Frequent Contributor

    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" "? 

    • apartamsetti's avatar
      apartamsetti
      New Contributor

      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..