相关疑难解决方法(0)

如何在Angular的HttpClient中使用reportProgress?

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

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

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

httpclient angular angular7

5
推荐指数
1
解决办法
3587
查看次数

标签 统计

angular ×1

angular7 ×1

httpclient ×1