Hi,
I am trying to write api test , where I am extracting a token from the first call and use it in the second post request, the insight example doesn’t seem to be working for me.
Hi,
I am trying to write api test , where I am extracting a token from the first call and use it in the second post request, the insight example doesn’t seem to be working for me.
Hi, @basma.asaad: Usually this happens because you are not making the second request within the callback function of the first one. The code should look like this:
$http.post(uri, data,
// Callback
function (err, response, body) {
// Extract response data
var data = JSON.parse(body);
// Make next call
$http.post(uri, data,
// Callback
function (err, response, body) {
// Handle response of second call
});
});