W3cubDocs

/Angular 11

@angular/common/http

entry-point

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

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

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

HttpClientXsrfModule

Configures XSRF protection support for outgoing requests.

Classes

HttpBackend

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

HttpClient

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

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

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

HttpHeaderResponse

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

HttpHeaders

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

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

HttpRequest

An outgoing HTTP request with an optional typed body.

HttpResponse

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

HttpResponseBase

Base class for both HttpResponse and HttpHeaderResponse.

HttpUrlEncodingCodec

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

HttpXhrBackend

Uses XMLHttpRequest to send requests to a backend server.

HttpXsrfTokenExtractor

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

JsonpClientBackend

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

JsonpInterceptor

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

XhrFactory

A wrapper around the XMLHttpRequest constructor.

Structures

HttpDownloadProgressEvent

A download progress event.

HttpEventType

Type enumeration for the different kinds of HttpEvent.

HttpInterceptor

Intercepts and handles an HttpRequest or HttpResponse.

HttpParameterCodec

A codec for encoding and decoding parameters in URLs.

HttpParamsOptions

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.

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.

© 2010–2021 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v11.angular.io/api/common/http