1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| pm.sendRequest({ url: "http://www.codezm.com/api/admin_user/login", method: 'POST', header: { 'Accept': 'application/json', 'Content-Type': 'application/x-www-form-urlencoded', }, body: { mode: 'urlencoded', urlencoded: [ {key: "username", value: "admin", disabled: false}, {key: "password", value: "admin", disabled: false}, ] } } , function (err, response) { pm.environment.set("X-TOKEN", response.json().result.token); });
|