Query Parameters Are Automatically Added to Request URL

Hi @NormativeSandra,

pm.request.url is an object. To get the URL string, you can use pm.request.url.toString(). The query params you’re seeing are likely coming from pm.sendRequest trying to parse the object into a URL string, as the params you’re getting are actually properties of the pm.request.url object.

You can try changing your code to something like this:

pm.sendRequest({
  url: pm.request.url.toString(),
  method: 'POST',
  header: {
    'content-type': 'application/json',
    'accept': '*/*',
    'connection': 'keep-alive'  
  },
  body: {
    mode: 'raw',
    raw: bodyRaw
  }}, function (err, res) {});

Hope that helps.

Best,

Kevin

1 Like