gpt4 book ai didi

angular - 如何在 Angular 的 HttpClient 中使用 reportProgress?

转载 作者:太空狗 更新时间:2023-10-29 18:06:26 26 4
gpt4 key购买 nike

<分区>

我正在使用 HTTP POST 方法下载文件。我想调用另一种方法向最终用户显示下载进度,直到文件下载完成。为此,如何在 HttpClient 中使用 reportProgress

  downfile(file: any): Observable<any> {

return this.http.post(this.url , app, {
responseType: "blob", reportProgress: true, headers: new HttpHeaders(
{ 'Content-Type': 'application/json' },
)
});
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com