填寫這份《一分鐘調查》,幫我們(開發組)做得更好!去填寫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.

入口點的匯出

模組

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.

類別

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).

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.

XhrFactory

XMLHttpRequest 建構函式的包裝器。

A wrapper around the XMLHttpRequest constructor.

結構

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.

HttpUploadProgressEvent

上傳進度事件。

An upload progress event.

HttpUserEvent

使用者定義的事件。

A user-defined event.

型別

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.