小编vik*_*vik的帖子

如何在 XmlHttpRequest 中使用 Angular 拦截器

我正在使用 Angular 4。还为任何 http 请求使用了 http 拦截器。https://angular.io/api/common/http/HttpInterceptor

但我使用 xmlHttpRequest 的发布请求之一用于某些文件上传事件。标头在 http post 请求(this.http.post(...))中设置正确。但是在 xmlHttpRequest 中,没有调用拦截器。所以不能设置标题。我如何处理 xmlHttpRequest(post 方法)中的 http 拦截器?

interceptor angular-http angular

6
推荐指数
1
解决办法
1858
查看次数

标签 统计

angular ×1

angular-http ×1

interceptor ×1