如何使用nodejs从jira服务器下载文件
How to download a file from a jira server using nodejs
我正在尝试从 jira 服务器下载文件,但使用请求模块时出现连接被拒绝错误(tls 握手错误)是否有任何 jira 模块可用于从 jira 服务器下载文件
我的nodejs代码:
var https = require('https');
var fs = require('fs');
var file = fs.createWriteStream("file.xlsx");
var request = https.get("https://gec-jira01.example.com/secure/attachment/206906/A-37_update.xlsx", function(response) {
response.pipe(file);
});
var credentials = 'user:pass';
var encodedCredentials = new Buffer(credentials).toString('base64');
request({
method: "GET",
"rejectUnauthorized": false,
"url": url,
"headers" :
{
"Content-Type": "application/json",
"Authorization": "Basic"+' '+encodedCredentials
}
},function(err,data,body){
//console.log(data.body);
console.log('file downloading');
}).pipe(fs.createWriteStream('file.xlsx'));
我正在尝试从 jira 服务器下载文件,但使用请求模块时出现连接被拒绝错误(tls 握手错误)是否有任何 jira 模块可用于从 jira 服务器下载文件
我的nodejs代码:
var https = require('https');
var fs = require('fs');
var file = fs.createWriteStream("file.xlsx");
var request = https.get("https://gec-jira01.example.com/secure/attachment/206906/A-37_update.xlsx", function(response) {
response.pipe(file);
});
var credentials = 'user:pass';
var encodedCredentials = new Buffer(credentials).toString('base64');
request({
method: "GET",
"rejectUnauthorized": false,
"url": url,
"headers" :
{
"Content-Type": "application/json",
"Authorization": "Basic"+' '+encodedCredentials
}
},function(err,data,body){
//console.log(data.body);
console.log('file downloading');
}).pipe(fs.createWriteStream('file.xlsx'));