// I have stored the generated Mock URL as Collection Variable let snapshotURL = pm.variables.get('snapshotURL'), /* Create the path that was used in actual request. We will send it along with our Mock endpoint */ path = pm.request.url.path.join('/'); /* If request contains any query params then pass those as well to mock endpoint */ if (pm.request.url.query.count()) { let params = pm.request.url.query.map((q) => { return `${q.key}=${q.value}`; }) path = `${path}?${params.join('&')}`; } // This is the final mock request that we will use. let snapshotFetchOptions = { url: `${snapshotURL}/${path}`, method: pm.request.method };