How to identify the Http method in Rest request.
I'm creating a VS, wherein am using the operations GET, PUT, POST, DELETE. I need to filter the response based on http method being invoked. For e.g if it is GET, I'll route the response to Retrieve step of JDBC, create a customized response and then route to VSI response selection. Whereas if the method is PUT, POST, DELETE I shall use a different JDBC step to perform the selected operation.
I'm unable to segregate the response based on Http method. Please help
Use this in your DPH.
method = lisa_vse_request.getMetaData().get("HTTP-Method");
Syed indicated a good way to retrieve the data you needed. As you want to do branching based on that data you can obviously also put that line in a scripted assertion added to your Listen-step (or any other step):
if (lisa_vse_request.getMetaData().get("HTTP-Method").equals("GET")) return true;
Thanks Syed, Danny - It worked.
Thank you so much