Javascript: Http 服务中的 reportProgress 是什么?

Javascript: What is reportProgress in Http Services?

reportProgress 在 Javascript 中做了什么,具体来说我们使用的是 Angular Typescript。正在尝试查找关于此的文档信息。

return this.httpClient.request<ProductResponse>('get',`${this.basePath}/api/Productcy/GetProductBNumber`,
    {
        params: queryParameters,
        withCredentials: this.configuration.withCredentials,
        headers: headers,
        observe: observe,
        reportProgress: reportProgress
    }
);

背景:使用 Angular 调用 Net Core API,使用 Swagger Codegen IO 代理生成器。

您需要使用 reportProgress: true 来显示任何 HTTP 请求的一些进度。如果您想查看所有事件,包括您需要使用观察的传输进度:'events' 选项以及 return HttpEvent 类型的 Observable。然后您可以在组件方法中捕获所有事件(DownloadProgress、Response..etc)。查找更多详细信息,请参阅 https://angular.io/guide/http#listening-to-progress-events