Forum Discussion
05ten
10 years agoContributor
I tried out your scenario and added a VirtAction GET /path/users and two responses "Response 1" and "Response 2" with SCRIPT dispatcher having the following code:
if ( mockRequest.httpRequest.queryString.contains('token') ) {
"Response 1"
}else{
"Response 2"
}
sending a GET to http://localhost:8080/path/users?q=token gives me Response 1 and anything else in the queryString returns Response 2.
I hope this helps a little on your way!
If not then can you please provide the dispatch script as a whole as well as a screenshot of the inspector content for your request inspector (the rightmost window). The more information you can provide, the better response you can get.
Related Content
- 9 years agoJames1