Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/475.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用不含摩卡的Superagent链接请求_Javascript_Node.js_Superagent - Fatal编程技术网

Javascript 使用不含摩卡的Superagent链接请求

Javascript 使用不含摩卡的Superagent链接请求,javascript,node.js,superagent,Javascript,Node.js,Superagent,这涉及到链接请求,但它使用的是mocha 如何在不使用Mocha或it的情况下链接superagent请求(在end方法中调用另一个restapi) 当我做链子的时候 superagent.post( URL ).send( DATA ).end( function(err,res){ console.log("1"); superagent.post( URL1 ).send( DATA1 ).end( function(err,res){ console.log("2");

这涉及到链接请求,但它使用的是
mocha

如何在不使用
Mocha
it
的情况下链接
superagent
请求(在end方法中调用另一个restapi)

当我做链子的时候

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

控制台上看不到任何一个console.log。

我真的不相信第一个console.log不会出现。@djechlin今天,如果没有嵌套,它也不能工作(记得上一个问题吗?)URL是可以通过浏览器访问的,但我得到了响应。@gurvinder372你解决过这个问题吗?我正处于第一个控制台日志将触发的位置,但第二个不会触发