如何结束管道http请求?

时间:2015-09-15 15:28:28

标签: javascript node.js

According to doc'sreq.end(); 方法应该"结束"完成后:

fs.createReadStream(fileInput).pipe(https.request(options, function(res){
    console.log(res);
}));

如果您对请求进行处理,您如何做到这一点?例如:

.end()

你在哪里致电SELECT o.order_id , o.order_status, o.customer_method, o.payment_method, o.customer_notes, o.order_date, p.name as product_name, p.price as product_price FROM (select o.* from timber_orders o order by order_id desc limit 10 ) o LEFT JOIN timber_order_products p on p.order_id = o.order_id ORDER BY o.order_id DESC LIMIT 10

1 个答案:

答案 0 :(得分:0)

由于request对象是具有end方法的对象,我希望这可行:

fs.createReadStream(fileInput).pipe(https.request(options, function(res){
    console.log(res);
}).end());