当我尝试它时,它将引发500错误,并且它的请求正文似乎有问题。双簧管库中的配置可能有问题,但是自安装以来我没有进行任何更改。
asyncMethod(fileToUpload, selectedDate) {
const formData = new FormData();
formData.append(
'positions',
new Blob([fileToUpload], {
type: 'application/octet-stream',
}),
);
oboe({
url: `/mct/api/compute/file?streamprogress=1&businessDate=${selectedDate}`,
body: formData,
method: 'POST',
headers: {
'Content-Type': 'multipart/form-data',
//'Content-Length': 1262,
'X-Requested-With': undefined,
},
})
.node('!.{percent}', function(data) {
console.log('--------------------');
console.log(data);
})
.done(function(data) {
console.log('-------------------DONE---------------------');
console.log(data);
})
.fail(function(data) {
console.log('-------------------FAIL---------------------');
console.log(data);
});
}