0
你好我試圖發佈多個圖像在1請求web服務,但在web服務中的數組值只有最後一個。 這裏是我的代碼:Node.js http post多個文件
var request = require('request');
console.log(images.length);
request.post(
{
url: path_api,
formData: {
user_id : username,
room_id : room_id,
filename : files[0].name,
origin_file : fs.createReadStream(path_origin_image),
attachments:["rizal1","rizal2"],
api_key :process.env.AWP_API_KEY
}
}, function(err, res, body) {
console.log(err);
console.log(body);
callback(err,res,body);
}
);
,這裏是我的服務器輸出後,奇怪的 output server 我想這些 desired output
感謝狀輸出
嘗試在兩行''attachment [0]「中指定附件值:」rizal1「,」attachment [1]「:」rizal2「' – idbehold
@idbehold感謝它的工作 – user3409738