mountebank

how to get value from param URL mountebank?


I have tried use inject to get param URL request like below

http://api.com?param1=test&param2=test2

I try to get param2 value :

var full_url = request.path;
var param2 = full_url.searchParams.get('param2');

but i can't get fullpath of URL i got only

http://api.com

Thanks


Solution

  • You'll want to look at request.query

    Try accessing request.query.param2 instead.

    var full_url = request.path;
    var param2 = request.query.param2;