I’m trying to do a GET in Pre-request that contains a body. It fails with a 400 error, {“error”:“No query parameter provided”}. If I do the request normally with the { “email”: email } set in the Body and raw JSON set it returns with a 200 and data. I’m not sure why it is having an issue when it is sent in the Pre-request. Other GETs to the same API that don’t have the Body work correctly in the Pre-request.
Here is the Pre-request that I am trying:
pm.sendRequest({
method: 'GET',
url: pm.collectionVariables.get("base_url") + '/api/v1/users/with_params',
header: {
'AuthToken': pm.collectionVariables.get("token"),
'Content-Type': 'application/json'
},
body: {
mode: 'raw',
raw: JSON.stringify({
"email": email
})
}
}, function (err, response) {
console.log(response);
});
Thanks,
Mick