axios({
method: 'get',
url: `https://demo.docusign.net/restapi/v2/accounts/{AccountID}/envelopes/{ID}/documents/1`,
headers: {
'X-DocuSign-Authentication': JSON.stringify({
"Username": docusign.username,
"Password": docusign.password,
"IntegratorKey": docusign.integratorKey
}),
'Content-Type': 'application/json'
},
}).then(response => {
fs.writeFileSync('./i.pdf', response.data, {encoding: 'binary'})
}).catch(console.log)
使用上面的代码我无法保存正确的文件,你能帮忙吗?