How to set the request body via Postman’s pre-request script?
If the request needs to be of type application/x-www-form-urlencoded: const options = { url: ‘http://some/url’, method: ‘POST’, header: { ‘Accept’: ‘*/*’, ‘Content-Type’: ‘application/x-www-form-urlencoded’, }, body: { mode: ‘urlencoded’, urlencoded : [ { key: ‘loginIdentity’, value: ‘admic’}, { key: ‘password’, value: ‘abc123’}, ] } }; pm.sendRequest(options, function (err, res) { // Use the err and res … Read more