填写这份《一分钟调查》,帮我们(开发组)做得更好!去填写Home

@angular/common/http

Implements an HTTP client API for Angular apps that relies on the XMLHttpRequest interface exposed by browsers.

Includes testability features, typed request and response objects, request and response interception, observable APIs, and streamlined error handling.

For usage information, see the HTTP Client guide.

入口点的导出

Entry point exports

NgModules

HttpClientJsonpModule

为支持 JSONP 的 HttpClient 配置依赖注入器。 如果没有该模块,Jsonp 请求就会被发送到后端,然后被后端拒绝。

Configures the dependency injector for HttpClient with supporting services for JSONP. Without this module, Jsonp requests reach the backend with method JSONP, where they are rejected.

HttpClientModule

为支持 XSRF 的 HttpClient 配置依赖注入器。它会被 HttpClientModule 自动导入。

Configures the dependency injector for HttpClient with supporting services for XSRF. Automatically imported by HttpClientModule.

HttpClientXsrfModule

配置 XSRF 保护,以支持外发请求。

Configures XSRF protection support for outgoing requests.

Classes

HttpBackend

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

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

HttpClient

执行 HTTP 请求。该服务作为可注入类提供,带有执行 HTTP 请求的方法。每个请求方法都有多个签名,并且返回类型会根据所调用的签名(主要的值是 observeresponseType)而有所不同。

Performs HTTP requests. This service is available as an injectable class, with methods to perform HTTP requests. Each request method has multiple signatures, and the return type varies based on the signature that is called (mainly the values of observe and responseType).

HttpContext

Http context stores arbitrary user defined values and ensures type safety without actually knowing the types. It is backed by a Map and guarantees that keys do not clash.

HttpContextToken

A token used to manipulate and access values stored in HttpContext.

HttpErrorResponse

一个用于表示错误或失败的响应对象,或者来自执行请求时发生的错误给出的失败的 HTTP 状态码,或者来自在解析响应对象期间发生的其它错误。

A response that represents an error or failure, either from a non-successful HTTP status, an error while executing the request, or some other failure which occurred during the parsing of the response.

HttpHandler

把一个 HttpRequest 转换成 HttpEvent 组成的流,HttpResponse 就是其中之一。

Transforms an HttpRequest into a stream of HttpEvents, one of which will likely be a HttpResponse.

HttpHeaderResponse

一个部分 HTTP 请求,它只包括状态和响应头数据,但没有响应体。

A partial HTTP response which only includes the status and header data, but no response body.

HttpHeaders

Http 头的不可变集合,惰性解析。

Represents the header configuration options for an HTTP request. Instances are immutable. Modifying methods return a cloned instance with the change. The original object is never changed.

HttpParams

HTTP 请求体/响应体,用来表示序列化参数,它们的 MIME 类型都是 application/x-www-form-urlencoded

An HTTP request/response body that represents serialized parameters, per the MIME type application/x-www-form-urlencoded.

HttpRequest

一个外发的 HTTP 请求,带有一个可选的类型化的请求体(body)。

An outgoing HTTP request with an optional typed body.

HttpResponse

一个完整的 HTTP 响应对象,包括一个带类型的响应体(如果没返回内容,则为 null)。

A full HTTP response, including a typed response body (which may be null if one was not returned).

HttpResponseBase

HttpResponseHttpHeaderResponse 的共同基类。

Base class for both HttpResponse and HttpHeaderResponse.

HttpUrlEncodingCodec

提供 URL 参数和查询字符串值的编码和解码。

Provides encoding and decoding of URL parameter and query-string values.

HttpXhrBackend

使用 XMLHttpRequest 将请求发送到后端服务器。

Uses XMLHttpRequest to send requests to a backend server.

HttpXsrfTokenExtractor

检索当前的 XSRF 令牌以用于下一个传出请求。

Retrieves the current XSRF token to use with the next outgoing request.

JsonpClientBackend

通过执行 JSONP 风格的请求,使用 JSONP 方法处理 HttpRequest

Processes an HttpRequest with the JSONP method, by performing JSONP style requests.

JsonpInterceptor

使用 JSONP 方法标识这些请求,并将其转移到 JsonpClientBackend

Identifies requests with the method JSONP and shifts them to the JsonpClientBackend.

结构

Structures

HttpDownloadProgressEvent

下载进度事件。

A download progress event.

HttpEventType

不同种类的 HttpEvent 的枚举类型。

Type enumeration for the different kinds of HttpEvent.

HttpInterceptor

拦截 HttpRequest 并处理它们。

Intercepts and handles an HttpRequest or HttpResponse.

HttpParameterCodec

一个用来在 URL 中编码和解码参数的编解码器。

A codec for encoding and decoding parameters in URLs.

HttpParamsOptions

用于构造 HttpParams 实例的选项。

Options used to construct an HttpParams instance.

HttpProgressEvent

进度事件的基础接口。

Base interface for progress events.

HttpSentEvent

用于表示请求已经发到服务器的事件。 当请求可能被多次接受时很有用,以区分出最终事件流上的重试行为。

An event indicating that the request was sent to the server. Useful when a request may be retried multiple times, to distinguish between retries on the final event stream.

HttpStatusCode

Http status codes. As per https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml

HttpUploadProgressEvent

上传进度事件。

An upload progress event.

HttpUserEvent

用户定义的事件。

A user-defined event.

类型

Types

HTTP_INTERCEPTORS

A multi-provider token that represents the array of registered HttpInterceptor objects.

HttpEvent

响应流中所有可能出现的事件的联合类型。

Union type for all possible events on the response stream.

XhrFactory

已弃用: XhrFactory has moved, please import XhrFactory from @angular/common instead.

A wrapper around the XMLHttpRequest constructor.