我有一个API,当我将客户ID作为表单数据提供给我时声明了一个函数,但它会返回音频。
因此,我尝试了以下代码以从API获得音频作为响应
GetAudioFile() {
this.postData5 = new FormData();
this.postData5.append('customer_id', this.customer_id);
const headers: HttpHeaders =
new HttpHeaders({
'Access-Control-Allow-Origin': '*'
});
this.httpService.post('api url', this.postData5, {
headers: headers,
})
.subscribe((responseData) => {
console.log(responseData);
});
}
它给我这样的错误: