HttpBackend

A final HttpHandler which will dispatch the request via browser HTTP APIs to a backend.

最后一个 HttpHandler,它将会把该请求通过浏览器的 HTTP API 发到后端。

abstract class HttpBackend implements HttpHandler { abstract handle(req: HttpRequest<any>): Observable<HttpEvent<any>> }

说明

Interceptors sit between the HttpClient interface and the HttpBackend.

拦截器位于 HttpClient 接口和 HttpBackend 之间。

When injected, HttpBackend dispatches requests directly to the backend, without going through the interceptor chain.

当它被注入时,HttpBackend 会把请求直接发给后端,而不会经过拦截器链。

方法

abstract handle(req: HttpRequest<any>): Observable<HttpEvent<any>>

参数

req

Type: HttpRequest.

返回值

Observable<HttpEvent<any>>