2

This question talks about chaining requests but it is using mocha.

How can I chain superagent requests (calling another rest API in the end method) without using Mocha or it?

When I do the chaining

superagent.post( URL ).send( DATA ).end( function(err,res){
  console.log("1");
  superagent.post( URL1 ).send( DATA1 ).end( function(err,res){
    console.log("2");
  });
});

Neither of the console.log is seen on the console.

Community
  • 1
  • 1
gurvinder372
  • 66,980
  • 10
  • 72
  • 94
  • I don't actually believe you that the first console.log won't appear. – djechlin Mar 25 '16 at 15:55
  • @djechlin well today it is not working without nesting also (remeber prev question?) URLs are reachable through browser though and I am getting a response. – gurvinder372 Mar 26 '16 at 08:31
  • @gurvinder372 did you ever get around this? I'm at the point where the first console log will trigger, but the second won't – Big Money Sep 07 '17 at 18:09

0 Answers0