Forum Discussion

rahuldutta's avatar
rahuldutta
Occasional Contributor
5 years ago

How to create a virtaction with a generic path

Hi,

I am trying to create a VS from Empty REST. I want to add a virtaction that will take any path for GET or POST or any other operation. 

e.g. My VirtAction will have GET /{Any path}. So, during playback any GET requests will match with that virtaction path.

Please suggest if the tool allows defining generic paths using regexp or anything.

Thanks!

4 Replies

  • Hopefully this might help 
    Create a new VirtAction, set the method as Get and Resource Path as /{operation}. Include the curly brackets

    Set your dispatch style to Sequence and set up a response

    so, as below,  when you visit the endpoint (regardless of the value for the operation parameter), you will get the same response
    http://localhost:8082/xyz 
    http://localhost:8082/efg