Hi all,
I have a photo upload POST request which I want to send in a “Pre-request Script” of another request. I’ve tried like this:
pm.sendRequest({
url: pm.environment.get("url") + '/photos/add.json?key={{user_key}}&is_public=1',
method: 'POST',
params: [{
"key": "user_key",
"value": pm.variables.get("user_key"),
"is_public":1,
}],
body: {
mode: 'formdata',
formdata: [{
"type":"file",
"src": "Users/ng/Postman/files/colorful-flower-on-dark-tropical-260nw-721703848.jp2",
}]
}
}, function(err, res) {
console.log(res);
});
It’s not working. I can’t find the solution