试试水
request(options1, function (error, response, body) {
var b=body.xx;
options2=b; //b作为参数的一部分
request(options2, function (error, response, body2) {
console.log(body2);
}}
这种情况会报 Error: Can't set headers after they are sent.
原因我箱大家应该都知道, 这种嵌套肯定是不对的, 想用promise,但是苦于还没摸清楚它怎么玩,有没有大牛指点下