@angular/common/http

package

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.

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

HttpHeaders class represents the header configuration options for an HTTP request. Instances should be assumed immutable with lazy parsing.

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

A class that uses encodeURIComponent and decodeURIComponent to serialize and parse URL parameter keys and values. If you pass URL query parameters without encoding, the query parameters can get misinterpreted at the receiving end. Use the HttpParameterCodec class to encode and decode the query-string values.

HttpXhrBackend

An HttpBackend which uses the XMLHttpRequest API to send requests to a backend server.

HttpXsrfTokenExtractor

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

JsonpClientBackend

HttpBackend that only processes HttpRequest with the JSONP method, by performing JSONP style requests.

JsonpInterceptor

An HttpInterceptor which 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 HttpRequest or HttpResponse and handles them.

HttpParameterCodec

A codec for encoding and decoding parameters in URLs.

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.

HttpUserEvent

A user-defined event.

Types

HTTP_INTERCEPTORS

A multi-provider token which represents the array of HttpInterceptors that are registered.

HttpEvent

Union type for all possible events on the response stream.

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