{ "id": "api/common/http", "title": "@angular/common/http", "contents": "\n\n
\n
\n
\n \n API > @angular/common\n
\n \n
\n \n
\n

@angular/common/httplink

\n \n \n \n \n
\n\n \n\n
\n

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

\n\n

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

\n

For usage information, see the HTTP Client guide.

\n\n\n \n\n\n \n\n

Entry point exportslink

\n \n \n \n \n \n
\n

NgModuleslink

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
HttpClientJsonpModule\n \n

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

\n\n
HttpClientModule\n \n

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

\n\n
HttpClientXsrfModule\n \n

Configures XSRF protection support for outgoing requests.

\n\n
\n
\n \n\n \n \n \n
\n

Classeslink

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
HttpBackend\n \n

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

\n\n
HttpClient\n \n

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

\n\n
HttpContext\n \n

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

\n\n
HttpContextToken\n \n

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

\n\n
HttpErrorResponse\n \n

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

\n\n
HttpHandler\n \n

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

\n\n
HttpHeaderResponse\n \n

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

\n\n
HttpHeaders\n \n

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

\n\n
HttpParams\n \n

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

\n\n
HttpRequest\n \n

An outgoing HTTP request with an optional typed body.

\n\n
HttpResponse\n \n

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

\n\n
HttpResponseBase\n \n

Base class for both HttpResponse and HttpHeaderResponse.

\n\n
HttpUrlEncodingCodec\n \n

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

\n\n
HttpXhrBackend\n \n

Uses XMLHttpRequest to send requests to a backend server.

\n\n
HttpXsrfTokenExtractor\n \n

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

\n\n
JsonpClientBackend\n \n

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

\n\n
JsonpInterceptor\n \n

Identifies requests with the method JSONP and\nshifts them to the JsonpClientBackend.

\n\n
\n
\n \n\n \n \n \n\n \n \n \n\n \n \n \n
\n

Structureslink

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
HttpDownloadProgressEvent\n \n

A download progress event.

\n\n
HttpEventType\n \n

Type enumeration for the different kinds of HttpEvent.

\n\n
HttpInterceptor\n \n

Intercepts and handles an HttpRequest or HttpResponse.

\n\n
HttpParameterCodec\n \n

A codec for encoding and decoding parameters in URLs.

\n\n
HttpParamsOptions\n \n

Options used to construct an HttpParams instance.

\n\n
HttpProgressEvent\n \n

Base interface for progress events.

\n\n
HttpSentEvent\n \n

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

\n\n
HttpStatusCode\n \n

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

\n\n
HttpUploadProgressEvent\n \n

An upload progress event.

\n\n
HttpUserEvent\n \n

A user-defined event.

\n\n
\n
\n \n\n \n \n \n\n \n \n \n\n \n \n \n
\n

Typeslink

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
HTTP_INTERCEPTORS\n \n

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

\n\n
HttpEvent\n \n

Union type for all possible events on the response stream.

\n\n
XhrFactory\n

Deprecated: XhrFactory has moved, please import XhrFactory from @angular/common instead.

\n\n

A wrapper around the XMLHttpRequest constructor.

\n\n
\n
\n \n\n
\n
\n\n\n" }