/** * @license Angular v12.2.9 * (c) 2010-2021 Google LLC. https://angular.io/ * License: MIT */ import { InjectionToken } from '@angular/core'; import { Injector } from '@angular/core'; import { ModuleWithProviders } from '@angular/core'; import { Observable } from 'rxjs'; import { XhrFactory as XhrFactory_2 } from '@angular/common'; /** * A multi-provider token that represents the array of registered * `HttpInterceptor` objects. * * @publicApi */ export declare const HTTP_INTERCEPTORS: InjectionToken; /** * A final `HttpHandler` which will dispatch the request via browser HTTP APIs to a backend. * * Interceptors sit between the `HttpClient` interface and the `HttpBackend`. * * When injected, `HttpBackend` dispatches requests directly to the backend, without going * through the interceptor chain. * * @publicApi */ export declare abstract class HttpBackend implements HttpHandler { abstract handle(req: HttpRequest): Observable>; } /** * 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`). * * Note that the `responseType` *options* value is a String that identifies the * single data type of the response. * A single overload version of the method handles each response type. * The value of `responseType` cannot be a union, as the combined signature could imply. * * @usageNotes * Sample HTTP requests for the [Tour of Heroes](/tutorial/toh-pt0) application. * * ### HTTP Request Example * * ``` * // GET heroes whose name contains search term * searchHeroes(term: string): observable{ * * const params = new HttpParams({fromString: 'name=term'}); * return this.httpClient.request('GET', this.heroesUrl, {responseType:'json', params}); * } * ``` * * Alternatively, the parameter string can be used without invoking HttpParams * by directly joining to the URL. * ``` * this.httpClient.request('GET', this.heroesUrl + '?' + 'name=term', {responseType:'json'}); * ``` * * * ### JSONP Example * ``` * requestJsonp(url, callback = 'callback') { * return this.httpClient.jsonp(this.heroesURL, callback); * } * ``` * * ### PATCH Example * ``` * // PATCH one of the heroes' name * patchHero (id: number, heroName: string): Observable<{}> { * const url = `${this.heroesUrl}/${id}`; // PATCH api/heroes/42 * return this.httpClient.patch(url, {name: heroName}, httpOptions) * .pipe(catchError(this.handleError('patchHero'))); * } * ``` * * @see [HTTP Guide](guide/http) * @see [HTTP Request](api/common/http/HttpRequest) * * @publicApi */ export declare class HttpClient { private handler; constructor(handler: HttpHandler); /** * Sends an `HttpRequest` and returns a stream of `HttpEvent`s. * * @return An `Observable` of the response, with the response body as a stream of `HttpEvent`s. */ request(req: HttpRequest): Observable>; /** * Constructs a request that interprets the body as an `ArrayBuffer` and returns the response in * an `ArrayBuffer`. * * @param method The HTTP method. * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * * @return An `Observable` of the response, with the response body as an `ArrayBuffer`. */ request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable; /** * Constructs a request that interprets the body as a blob and returns * the response as a blob. * * @param method The HTTP method. * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response, with the response body of type `Blob`. */ request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'blob'; withCredentials?: boolean; }): Observable; /** * Constructs a request that interprets the body as a text string and * returns a string value. * * @param method The HTTP method. * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response, with the response body of type string. */ request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; }): Observable; /** * Constructs a request that interprets the body as an `ArrayBuffer` and returns the * the full event stream. * * @param method The HTTP method. * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response, with the response body as an array of `HttpEvent`s for * the request. */ request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; observe: 'events'; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable>; /** * Constructs a request that interprets the body as a `Blob` and returns * the full event stream. * * @param method The HTTP method. * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of all `HttpEvent`s for the request, * with the response body of type `Blob`. */ request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'blob'; withCredentials?: boolean; }): Observable>; /** * Constructs a request which interprets the body as a text string and returns the full event * stream. * * @param method The HTTP method. * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of all `HttpEvent`s for the request, * with the response body of type string. */ request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; }): Observable>; /** * Constructs a request which interprets the body as a JSON object and returns the full event * stream. * * @param method The HTTP method. * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of all `HttpEvent`s for the request, * with the response body of type `Object`. */ request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; reportProgress?: boolean; observe: 'events'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; responseType?: 'json'; withCredentials?: boolean; }): Observable>; /** * Constructs a request which interprets the body as a JSON object and returns the full event * stream. * * @param method The HTTP method. * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of all `HttpEvent`s for the request, * with the response body of type `R`. */ request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; reportProgress?: boolean; observe: 'events'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; responseType?: 'json'; withCredentials?: boolean; }): Observable>; /** * Constructs a request which interprets the body as an `ArrayBuffer` * and returns the full `HttpResponse`. * * @param method The HTTP method. * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HttpResponse`, with the response body as an `ArrayBuffer`. */ request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable>; /** * Constructs a request which interprets the body as a `Blob` and returns the full `HttpResponse`. * * @param method The HTTP method. * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HttpResponse`, with the response body of type `Blob`. */ request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'blob'; withCredentials?: boolean; }): Observable>; /** * Constructs a request which interprets the body as a text stream and returns the full * `HttpResponse`. * * @param method The HTTP method. * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the HTTP response, with the response body of type string. */ request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; }): Observable>; /** * Constructs a request which interprets the body as a JSON object and returns the full * `HttpResponse`. * * @param method The HTTP method. * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the full `HttpResponse`, * with the response body of type `Object`. */ request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; reportProgress?: boolean; observe: 'response'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; responseType?: 'json'; withCredentials?: boolean; }): Observable>; /** * Constructs a request which interprets the body as a JSON object and returns * the full `HttpResponse` with the response body in the requested type. * * @param method The HTTP method. * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the full `HttpResponse`, with the response body of type `R`. */ request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; reportProgress?: boolean; observe: 'response'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; responseType?: 'json'; withCredentials?: boolean; }): Observable>; /** * Constructs a request which interprets the body as a JSON object and returns the full * `HttpResponse` as a JSON object. * * @param method The HTTP method. * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HttpResponse`, with the response body of type `Object`. */ request(method: string, url: string, options?: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; responseType?: 'json'; reportProgress?: boolean; withCredentials?: boolean; }): Observable; /** * Constructs a request which interprets the body as a JSON object * with the response body of the requested type. * * @param method The HTTP method. * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HttpResponse`, with the response body of type `R`. */ request(method: string, url: string, options?: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; responseType?: 'json'; reportProgress?: boolean; withCredentials?: boolean; }): Observable; /** * Constructs a request where response type and requested observable are not known statically. * * @param method The HTTP method. * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the requested response, with body of type `any`. */ request(method: string, url: string, options?: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; observe?: 'body' | 'events' | 'response'; reportProgress?: boolean; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; }): Observable; /** * Constructs a `DELETE` request that interprets the body as an `ArrayBuffer` * and returns the response as an `ArrayBuffer`. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response body as an `ArrayBuffer`. */ delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; body?: any | null; }): Observable; /** * Constructs a `DELETE` request that interprets the body as a `Blob` and returns * the response as a `Blob`. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response body as a `Blob`. */ delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'blob'; withCredentials?: boolean; body?: any | null; }): Observable; /** * Constructs a `DELETE` request that interprets the body as a text string and returns * a string. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response, with the response body of type string. */ delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; body?: any | null; }): Observable; /** * Constructs a `DELETE` request that interprets the body as an `ArrayBuffer` * and returns the full event stream. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of all `HttpEvent`s for the request, * with response body as an `ArrayBuffer`. */ delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; body?: any | null; }): Observable>; /** * Constructs a `DELETE` request that interprets the body as a `Blob` * and returns the full event stream. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of all the `HttpEvent`s for the request, with the response body as a * `Blob`. */ delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'blob'; withCredentials?: boolean; body?: any | null; }): Observable>; /** * Constructs a `DELETE` request that interprets the body as a text string * and returns the full event stream. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of all `HttpEvent`s for the request, with the response * body of type string. */ delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; body?: any | null; }): Observable>; /** * Constructs a `DELETE` request that interprets the body as a JSON object * and returns the full event stream. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of all `HttpEvent`s for the request, with response body of * type `Object`. */ delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; body?: any | null; }): Observable>; /** * Constructs a `DELETE`request that interprets the body as a JSON object * and returns the full event stream. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of all the `HttpEvent`s for the request, with a response * body in the requested type. */ delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | (string | number | boolean)[]; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; body?: any | null; }): Observable>; /** * Constructs a `DELETE` request that interprets the body as an `ArrayBuffer` and returns * the full `HttpResponse`. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the full `HttpResponse`, with the response body as an `ArrayBuffer`. */ delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; body?: any | null; }): Observable>; /** * Constructs a `DELETE` request that interprets the body as a `Blob` and returns the full * `HttpResponse`. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HttpResponse`, with the response body of type `Blob`. */ delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'blob'; withCredentials?: boolean; body?: any | null; }): Observable>; /** * Constructs a `DELETE` request that interprets the body as a text stream and * returns the full `HttpResponse`. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the full `HttpResponse`, with the response body of type string. */ delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; body?: any | null; }): Observable>; /** * Constructs a `DELETE` request the interprets the body as a JSON object and returns * the full `HttpResponse`. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HttpResponse`, with the response body of type `Object`. * */ delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; body?: any | null; }): Observable>; /** * Constructs a `DELETE` request that interprets the body as a JSON object * and returns the full `HttpResponse`. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HttpResponse`, with the response body of the requested type. */ delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; body?: any | null; }): Observable>; /** * Constructs a `DELETE` request that interprets the body as a JSON object and * returns the response body as a JSON object. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response, with the response body of type `Object`. */ delete(url: string, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; body?: any | null; }): Observable; /** * Constructs a DELETE request that interprets the body as a JSON object and returns * the response in a given type. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HttpResponse`, with response body in the requested type. */ delete(url: string, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; body?: any | null; }): Observable; /** * Constructs a `GET` request that interprets the body as an `ArrayBuffer` and returns the * response in an `ArrayBuffer`. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response, with the response body as an `ArrayBuffer`. */ get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable; /** * Constructs a `GET` request that interprets the body as a `Blob` * and returns the response as a `Blob`. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response, with the response body as a `Blob`. */ get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'blob'; withCredentials?: boolean; }): Observable; /** * Constructs a `GET` request that interprets the body as a text string * and returns the response as a string value. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response, with the response body of type string. */ get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; }): Observable; /** * Constructs a `GET` request that interprets the body as an `ArrayBuffer` and returns * the full event stream. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of all `HttpEvent`s for the request, with the response * body as an `ArrayBuffer`. */ get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable>; /** * Constructs a `GET` request that interprets the body as a `Blob` and * returns the full event stream. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response, with the response body as a `Blob`. */ get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'blob'; withCredentials?: boolean; }): Observable>; /** * Constructs a `GET` request that interprets the body as a text string and returns * the full event stream. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response, with the response body of type string. */ get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; }): Observable>; /** * Constructs a `GET` request that interprets the body as a JSON object * and returns the full event stream. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response, with the response body of type `Object`. */ get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable>; /** * Constructs a `GET` request that interprets the body as a JSON object and returns the full event * stream. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response, with a response body in the requested type. */ get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable>; /** * Constructs a `GET` request that interprets the body as an `ArrayBuffer` and * returns the full `HttpResponse`. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HttpResponse` for the request, * with the response body as an `ArrayBuffer`. */ get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable>; /** * Constructs a `GET` request that interprets the body as a `Blob` and * returns the full `HttpResponse`. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HttpResponse` for the request, * with the response body as a `Blob`. */ get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'blob'; withCredentials?: boolean; }): Observable>; /** * Constructs a `GET` request that interprets the body as a text stream and * returns the full `HttpResponse`. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HttpResponse` for the request, * with the response body of type string. */ get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; }): Observable>; /** * Constructs a `GET` request that interprets the body as a JSON object and * returns the full `HttpResponse`. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the full `HttpResponse`, * with the response body of type `Object`. */ get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable>; /** * Constructs a `GET` request that interprets the body as a JSON object and * returns the full `HttpResponse`. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the full `HttpResponse` for the request, * with a response body in the requested type. */ get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable>; /** * Constructs a `GET` request that interprets the body as a JSON object and * returns the response body as a JSON object. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * * @return An `Observable` of the response body as a JSON object. */ get(url: string, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable; /** * Constructs a `GET` request that interprets the body as a JSON object and returns * the response body in a given type. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HttpResponse`, with a response body in the requested type. */ get(url: string, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable; /** * Constructs a `HEAD` request that interprets the body as an `ArrayBuffer` and * returns the response as an `ArrayBuffer`. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response, with the response body as an `ArrayBuffer`. */ head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable; /** * Constructs a `HEAD` request that interprets the body as a `Blob` and returns * the response as a `Blob`. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response, with the response body as a `Blob`. */ head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'blob'; withCredentials?: boolean; }): Observable; /** * Constructs a `HEAD` request that interprets the body as a text string and returns the response * as a string value. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response, with the response body of type string. */ head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; }): Observable; /** * Constructs a `HEAD` request that interprets the body as an `ArrayBuffer` * and returns the full event stream. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of all `HttpEvent`s for the request, * with the response body as an `ArrayBuffer`. */ head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable>; /** * Constructs a `HEAD` request that interprets the body as a `Blob` and * returns the full event stream. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of all `HttpEvent`s for the request, * with the response body as a `Blob`. */ head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'blob'; withCredentials?: boolean; }): Observable>; /** * Constructs a `HEAD` request that interprets the body as a text string * and returns the full event stream. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of all `HttpEvent`s for the request, with the response body of type * string. */ head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; }): Observable>; /** * Constructs a `HEAD` request that interprets the body as a JSON object * and returns the full HTTP event stream. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of all `HttpEvent`s for the request, with a response body of * type `Object`. */ head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable>; /** * Constructs a `HEAD` request that interprets the body as a JSON object and * returns the full event stream. * * @return An `Observable` of all the `HttpEvent`s for the request, * with a response body in the requested type. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. */ head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable>; /** * Constructs a `HEAD` request that interprets the body as an `ArrayBuffer` * and returns the full HTTP response. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HttpResponse` for the request, * with the response body as an `ArrayBuffer`. */ head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable>; /** * Constructs a `HEAD` request that interprets the body as a `Blob` and returns * the full `HttpResponse`. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HttpResponse` for the request, * with the response body as a blob. */ head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'blob'; withCredentials?: boolean; }): Observable>; /** * Constructs a `HEAD` request that interprets the body as text stream * and returns the full `HttpResponse`. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HttpResponse` for the request, * with the response body of type string. */ head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; }): Observable>; /** * Constructs a `HEAD` request that interprets the body as a JSON object and * returns the full `HttpResponse`. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HttpResponse` for the request, * with the response body of type `Object`. */ head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable>; /** * Constructs a `HEAD` request that interprets the body as a JSON object * and returns the full `HttpResponse`. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HttpResponse` for the request, * with a response body of the requested type. */ head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable>; /** * Constructs a `HEAD` request that interprets the body as a JSON object and * returns the response body as a JSON object. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the response, with the response body as a JSON object. */ head(url: string, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable; /** * Constructs a `HEAD` request that interprets the body as a JSON object and returns * the response in a given type. * * @param url The endpoint URL. * @param options The HTTP options to send with the request. * * @return An `Observable` of the `HttpResponse` for the request, * with a response body of the given type. */ head(url: string, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable; /** * Constructs a `JSONP` request for the given URL and name of the callback parameter. * * @param url The resource URL. * @param callbackParam The callback function name. * * @return An `Observable` of the response object, with response body as an object. */ jsonp(url: string, callbackParam: string): Observable; /** * Constructs a `JSONP` request for the given URL and name of the callback parameter. * * @param url The resource URL. * @param callbackParam The callback function name. * * You must install a suitable interceptor, such as one provided by `HttpClientJsonpModule`. * If no such interceptor is reached, * then the `JSONP` request can be rejected by the configured backend. * * @return An `Observable` of the response object, with response body in the requested type. */ jsonp(url: string, callbackParam: string): Observable; /** * Constructs an `OPTIONS` request that interprets the body as an * `ArrayBuffer` and returns the response as an `ArrayBuffer`. * * @param url The endpoint URL. * @param options HTTP options. * * @return An `Observable` of the response, with the response body as an `ArrayBuffer`. */ options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable; /** * Constructs an `OPTIONS` request that interprets the body as a `Blob` and returns * the response as a `Blob`. * * @param url The endpoint URL. * @param options HTTP options. * * @return An `Observable` of the response, with the response body as a `Blob`. */ options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'blob'; withCredentials?: boolean; }): Observable; /** * Constructs an `OPTIONS` request that interprets the body as a text string and * returns a string value. * * @param url The endpoint URL. * @param options HTTP options. * * @return An `Observable` of the response, with the response body of type string. */ options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; }): Observable; /** * Constructs an `OPTIONS` request that interprets the body as an `ArrayBuffer` * and returns the full event stream. * * @param url The endpoint URL. * @param options HTTP options. * * @return An `Observable` of all `HttpEvent`s for the request, * with the response body as an `ArrayBuffer`. */ options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable>; /** * Constructs an `OPTIONS` request that interprets the body as a `Blob` and * returns the full event stream. * * @param url The endpoint URL. * @param options HTTP options. * * @return An `Observable` of all `HttpEvent`s for the request, * with the response body as a `Blob`. */ options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'blob'; withCredentials?: boolean; }): Observable>; /** * Constructs an `OPTIONS` request that interprets the body as a text string * and returns the full event stream. * * @param url The endpoint URL. * @param options HTTP options. * * @return An `Observable` of all the `HttpEvent`s for the request, * with the response body of type string. */ options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; }): Observable>; /** * Constructs an `OPTIONS` request that interprets the body as a JSON object * and returns the full event stream. * * @param url The endpoint URL. * @param options HTTP options. * * @return An `Observable` of all the `HttpEvent`s for the request with the response * body of type `Object`. */ options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable>; /** * Constructs an `OPTIONS` request that interprets the body as a JSON object and * returns the full event stream. * * @param url The endpoint URL. * @param options HTTP options. * * @return An `Observable` of all the `HttpEvent`s for the request, * with a response body in the requested type. */ options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable>; /** * Constructs an `OPTIONS` request that interprets the body as an `ArrayBuffer` * and returns the full HTTP response. * * @param url The endpoint URL. * @param options HTTP options. * * @return An `Observable` of the `HttpResponse` for the request, * with the response body as an `ArrayBuffer`. */ options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable>; /** * Constructs an `OPTIONS` request that interprets the body as a `Blob` * and returns the full `HttpResponse`. * * @param url The endpoint URL. * @param options HTTP options. * * @return An `Observable` of the `HttpResponse` for the request, * with the response body as a `Blob`. */ options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'blob'; withCredentials?: boolean; }): Observable>; /** * Constructs an `OPTIONS` request that interprets the body as text stream * and returns the full `HttpResponse`. * * @param url The endpoint URL. * @param options HTTP options. * * @return An `Observable` of the `HttpResponse` for the request, * with the response body of type string. */ options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; }): Observable>; /** * Constructs an `OPTIONS` request that interprets the body as a JSON object * and returns the full `HttpResponse`. * * @param url The endpoint URL. * @param options HTTP options. * * @return An `Observable` of the `HttpResponse` for the request, * with the response body of type `Object`. */ options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable>; /** * Constructs an `OPTIONS` request that interprets the body as a JSON object and * returns the full `HttpResponse`. * * @param url The endpoint URL. * @param options HTTP options. * * @return An `Observable` of the `HttpResponse` for the request, * with a response body in the requested type. */ options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable>; /** * Constructs an `OPTIONS` request that interprets the body as a JSON object and returns the * response body as a JSON object. * * @param url The endpoint URL. * @param options HTTP options. * * @return An `Observable` of the response, with the response body as a JSON object. */ options(url: string, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable; /** * Constructs an `OPTIONS` request that interprets the body as a JSON object and returns the * response in a given type. * * @param url The endpoint URL. * @param options HTTP options. * * @return An `Observable` of the `HttpResponse`, with a response body of the given type. */ options(url: string, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable; /** * Constructs a `PATCH` request that interprets the body as an `ArrayBuffer` and returns * the response as an `ArrayBuffer`. * * @param url The endpoint URL. * @param body The resources to edit. * @param options HTTP options. * * @return An `Observable` of the response, with the response body as an `ArrayBuffer`. */ patch(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable; /** * Constructs a `PATCH` request that interprets the body as a `Blob` and returns the response * as a `Blob`. * * @param url The endpoint URL. * @param body The resources to edit. * @param options HTTP options. * * @return An `Observable` of the response, with the response body as a `Blob`. */ patch(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'blob'; withCredentials?: boolean; }): Observable; /** * Constructs a `PATCH` request that interprets the body as a text string and * returns the response as a string value. * * @param url The endpoint URL. * @param body The resources to edit. * @param options HTTP options. * * @return An `Observable` of the response, with a response body of type string. */ patch(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; }): Observable; /** * Constructs a `PATCH` request that interprets the body as an `ArrayBuffer` and * returns the full event stream. * * @param url The endpoint URL. * @param body The resources to edit. * @param options HTTP options. * * @return An `Observable` of all the `HttpEvent`s for the request, * with the response body as an `ArrayBuffer`. */ patch(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable>; /** * Constructs a `PATCH` request that interprets the body as a `Blob` * and returns the full event stream. * * @param url The endpoint URL. * @param body The resources to edit. * @param options HTTP options. * * @return An `Observable` of all the `HttpEvent`s for the request, with the * response body as `Blob`. */ patch(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'blob'; withCredentials?: boolean; }): Observable>; /** * Constructs a `PATCH` request that interprets the body as a text string and * returns the full event stream. * * @param url The endpoint URL. * @param body The resources to edit. * @param options HTTP options. * * @return An `Observable` of all the `HttpEvent`s for the request, with a * response body of type string. */ patch(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; }): Observable>; /** * Constructs a `PATCH` request that interprets the body as a JSON object * and returns the full event stream. * * @param url The endpoint URL. * @param body The resources to edit. * @param options HTTP options. * * @return An `Observable` of all the `HttpEvent`s for the request, * with a response body of type `Object`. */ patch(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable>; /** * Constructs a `PATCH` request that interprets the body as a JSON object * and returns the full event stream. * * @param url The endpoint URL. * @param body The resources to edit. * @param options HTTP options. * * @return An `Observable` of all the `HttpEvent`s for the request, * with a response body in the requested type. */ patch(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable>; /** * Constructs a `PATCH` request that interprets the body as an `ArrayBuffer` * and returns the full `HttpResponse`. * * @param url The endpoint URL. * @param body The resources to edit. * @param options HTTP options. * * @return An `Observable` of the `HttpResponse` for the request, * with the response body as an `ArrayBuffer`. */ patch(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable>; /** * Constructs a `PATCH` request that interprets the body as a `Blob` and returns the full * `HttpResponse`. * * @param url The endpoint URL. * @param body The resources to edit. * @param options HTTP options. * * @return An `Observable` of the `HttpResponse` for the request, * with the response body as a `Blob`. */ patch(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'blob'; withCredentials?: boolean; }): Observable>; /** * Constructs a `PATCH` request that interprets the body as a text stream and returns the * full `HttpResponse`. * * @param url The endpoint URL. * @param body The resources to edit. * @param options HTTP options. * * @return An `Observable` of the `HttpResponse` for the request, * with a response body of type string. */ patch(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; }): Observable>; /** * Constructs a `PATCH` request that interprets the body as a JSON object * and returns the full `HttpResponse`. * * @param url The endpoint URL. * @param body The resources to edit. * @param options HTTP options. * * @return An `Observable` of the `HttpResponse` for the request, * with a response body in the requested type. */ patch(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable>; /** * Constructs a `PATCH` request that interprets the body as a JSON object * and returns the full `HttpResponse`. * * @param url The endpoint URL. * @param body The resources to edit. * @param options HTTP options. * * @return An `Observable` of the `HttpResponse` for the request, * with a response body in the given type. */ patch(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable>; /** * Constructs a `PATCH` request that interprets the body as a JSON object and * returns the response body as a JSON object. * * @param url The endpoint URL. * @param body The resources to edit. * @param options HTTP options. * * @return An `Observable` of the response, with the response body as a JSON object. */ patch(url: string, body: any | null, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable; /** * Constructs a `PATCH` request that interprets the body as a JSON object * and returns the response in a given type. * * @param url The endpoint URL. * @param body The resources to edit. * @param options HTTP options. * * @return An `Observable` of the `HttpResponse` for the request, * with a response body in the given type. */ patch(url: string, body: any | null, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable; /** * Constructs a `POST` request that interprets the body as an `ArrayBuffer` and returns * an `ArrayBuffer`. * * @param url The endpoint URL. * @param body The content to replace with. * @param options HTTP options. * * @return An `Observable` of the response, with the response body as an `ArrayBuffer`. */ post(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable; /** * Constructs a `POST` request that interprets the body as a `Blob` and returns the * response as a `Blob`. * * @param url The endpoint URL. * @param body The content to replace with. * @param options HTTP options * * @return An `Observable` of the response, with the response body as a `Blob`. */ post(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'blob'; withCredentials?: boolean; }): Observable; /** * Constructs a `POST` request that interprets the body as a text string and * returns the response as a string value. * * @param url The endpoint URL. * @param body The content to replace with. * @param options HTTP options * * @return An `Observable` of the response, with a response body of type string. */ post(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; }): Observable; /** * Constructs a `POST` request that interprets the body as an `ArrayBuffer` and * returns the full event stream. * * @param url The endpoint URL. * @param body The content to replace with. * @param options HTTP options * * @return An `Observable` of all `HttpEvent`s for the request, * with the response body as an `ArrayBuffer`. */ post(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable>; /** * Constructs a `POST` request that interprets the body as a `Blob` * and returns the response in an observable of the full event stream. * * @param url The endpoint URL. * @param body The content to replace with. * @param options HTTP options * * @return An `Observable` of all `HttpEvent`s for the request, with the response body as `Blob`. */ post(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'blob'; withCredentials?: boolean; }): Observable>; /** * Constructs a `POST` request that interprets the body as a text string and returns the full * event stream. * * @param url The endpoint URL. * @param body The content to replace with. * @param options HTTP options * * @return An `Observable` of all `HttpEvent`s for the request, * with a response body of type string. */ post(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; }): Observable>; /** * Constructs a POST request that interprets the body as a JSON object and returns the full event * stream. * * @param url The endpoint URL. * @param body The content to replace with. * @param options HTTP options * * @return An `Observable` of all `HttpEvent`s for the request, * with a response body of type `Object`. */ post(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable>; /** * Constructs a POST request that interprets the body as a JSON object and returns the full event * stream. * * @param url The endpoint URL. * @param body The content to replace with. * @param options HTTP options * * @return An `Observable` of all `HttpEvent`s for the request, * with a response body in the requested type. */ post(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable>; /** * Constructs a POST request that interprets the body as an `ArrayBuffer` * and returns the full `HttpResponse`. * * @param url The endpoint URL. * @param body The content to replace with. * @param options HTTP options * * @return An `Observable` of the `HttpResponse` for the request, with the response body as an * `ArrayBuffer`. */ post(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable>; /** * Constructs a `POST` request that interprets the body as a `Blob` and returns the full * `HttpResponse`. * * @param url The endpoint URL. * @param body The content to replace with. * @param options HTTP options * * @return An `Observable` of the `HttpResponse` for the request, * with the response body as a `Blob`. */ post(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'blob'; withCredentials?: boolean; }): Observable>; /** * Constructs a `POST` request that interprets the body as a text stream and returns * the full `HttpResponse`. * * @param url The endpoint URL. * @param body The content to replace with. * @param options HTTP options * * @return An `Observable` of the `HttpResponse` for the request, * with a response body of type string. */ post(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; }): Observable>; /** * Constructs a `POST` request that interprets the body as a JSON object * and returns the full `HttpResponse`. * * @param url The endpoint URL. * @param body The content to replace with. * @param options HTTP options * * @return An `Observable` of the `HttpResponse` for the request, with a response body of type * `Object`. */ post(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable>; /** * Constructs a `POST` request that interprets the body as a JSON object and returns the full * `HttpResponse`. * * * @param url The endpoint URL. * @param body The content to replace with. * @param options HTTP options * * @return An `Observable` of the `HttpResponse` for the request, with a response body in the * requested type. */ post(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable>; /** * Constructs a `POST` request that interprets the body as a * JSON object and returns the response body as a JSON object. * * @param url The endpoint URL. * @param body The content to replace with. * @param options HTTP options * * @return An `Observable` of the response, with the response body as a JSON object. */ post(url: string, body: any | null, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable; /** * Constructs a `POST` request that interprets the body as a JSON object * and returns an observable of the response. * * @param url The endpoint URL. * @param body The content to replace with. * @param options HTTP options * * @return An `Observable` of the `HttpResponse` for the request, with a response body in the * requested type. */ post(url: string, body: any | null, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable; /** * Constructs a `PUT` request that interprets the body as an `ArrayBuffer` and returns the * response as an `ArrayBuffer`. * * @param url The endpoint URL. * @param body The resources to add/update. * @param options HTTP options * * @return An `Observable` of the response, with the response body as an `ArrayBuffer`. */ put(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable; /** * Constructs a `PUT` request that interprets the body as a `Blob` and returns * the response as a `Blob`. * * @param url The endpoint URL. * @param body The resources to add/update. * @param options HTTP options * * @return An `Observable` of the response, with the response body as a `Blob`. */ put(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'blob'; withCredentials?: boolean; }): Observable; /** * Constructs a `PUT` request that interprets the body as a text string and * returns the response as a string value. * * @param url The endpoint URL. * @param body The resources to add/update. * @param options HTTP options * * @return An `Observable` of the response, with a response body of type string. */ put(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; }): Observable; /** * Constructs a `PUT` request that interprets the body as an `ArrayBuffer` and * returns the full event stream. * * @param url The endpoint URL. * @param body The resources to add/update. * @param options HTTP options * * @return An `Observable` of all `HttpEvent`s for the request, * with the response body as an `ArrayBuffer`. */ put(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable>; /** * Constructs a `PUT` request that interprets the body as a `Blob` and returns the full event * stream. * * @param url The endpoint URL. * @param body The resources to add/update. * @param options HTTP options * * @return An `Observable` of all `HttpEvent`s for the request, * with the response body as a `Blob`. */ put(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'blob'; withCredentials?: boolean; }): Observable>; /** * Constructs a `PUT` request that interprets the body as a text string and returns the full event * stream. * * @param url The endpoint URL. * @param body The resources to add/update. * @param options HTTP options * * @return An `Observable` of all `HttpEvent`s for the request, with a response body * of type string. */ put(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; }): Observable>; /** * Constructs a `PUT` request that interprets the body as a JSON object and returns the full event * stream. * * @param url The endpoint URL. * @param body The resources to add/update. * @param options HTTP options * * @return An `Observable` of all `HttpEvent`s for the request, with a response body of * type `Object`. */ put(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable>; /** * Constructs a `PUT` request that interprets the body as a JSON object and returns the * full event stream. * * @param url The endpoint URL. * @param body The resources to add/update. * @param options HTTP options * * @return An `Observable` of all `HttpEvent`s for the request, * with a response body in the requested type. */ put(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'events'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable>; /** * Constructs a `PUT` request that interprets the body as an * `ArrayBuffer` and returns an observable of the full HTTP response. * * @param url The endpoint URL. * @param body The resources to add/update. * @param options HTTP options * * @return An `Observable` of the `HttpResponse` for the request, with the response body as an * `ArrayBuffer`. */ put(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable>; /** * Constructs a `PUT` request that interprets the body as a `Blob` and returns the * full HTTP response. * * @param url The endpoint URL. * @param body The resources to add/update. * @param options HTTP options * * @return An `Observable` of the `HttpResponse` for the request, * with the response body as a `Blob`. */ put(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'blob'; withCredentials?: boolean; }): Observable>; /** * Constructs a `PUT` request that interprets the body as a text stream and returns the * full HTTP response. * * @param url The endpoint URL. * @param body The resources to add/update. * @param options HTTP options * * @return An `Observable` of the `HttpResponse` for the request, with a response body of type * string. */ put(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType: 'text'; withCredentials?: boolean; }): Observable>; /** * Constructs a `PUT` request that interprets the body as a JSON object and returns the full HTTP * response. * * @param url The endpoint URL. * @param body The resources to add/update. * @param options HTTP options * * @return An `Observable` of the `HttpResponse` for the request, with a response body * of type 'Object`. */ put(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable>; /** * Constructs a `PUT` request that interprets the body as an instance of the requested type and * returns the full HTTP response. * * @param url The endpoint URL. * @param body The resources to add/update. * @param options HTTP options * * @return An `Observable` of the `HttpResponse` for the request, * with a response body in the requested type. */ put(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: 'response'; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable>; /** * Constructs a `PUT` request that interprets the body as a JSON object * and returns an observable of JSON object. * * @param url The endpoint URL. * @param body The resources to add/update. * @param options HTTP options * * @return An `Observable` of the response as a JSON object. */ put(url: string, body: any | null, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable; /** * Constructs a `PUT` request that interprets the body as an instance of the requested type * and returns an observable of the requested type. * * @param url The endpoint URL. * @param body The resources to add/update. * @param options HTTP options * * @return An `Observable` of the requested type. */ put(url: string, body: any | null, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: 'body'; params?: HttpParams | { [param: string]: string | number | boolean | ReadonlyArray; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable; } /** * Configures the [dependency injector](guide/glossary#injector) for `HttpClient` * with supporting services for JSONP. * Without this module, Jsonp requests reach the backend * with method JSONP, where they are rejected. * * You can add interceptors to the chain behind `HttpClient` by binding them to the * multiprovider for built-in [DI token](guide/glossary#di-token) `HTTP_INTERCEPTORS`. * * @publicApi */ export declare class HttpClientJsonpModule { } /** * Configures the [dependency injector](guide/glossary#injector) for `HttpClient` * with supporting services for XSRF. Automatically imported by `HttpClientModule`. * * You can add interceptors to the chain behind `HttpClient` by binding them to the * multiprovider for built-in [DI token](guide/glossary#di-token) `HTTP_INTERCEPTORS`. * * @publicApi */ export declare class HttpClientModule { } /** * Configures XSRF protection support for outgoing requests. * * For a server that supports a cookie-based XSRF protection system, * use directly to configure XSRF protection with the correct * cookie and header names. * * If no names are supplied, the default cookie name is `XSRF-TOKEN` * and the default header name is `X-XSRF-TOKEN`. * * @publicApi */ export declare class HttpClientXsrfModule { /** * Disable the default XSRF protection. */ static disable(): ModuleWithProviders; /** * Configure XSRF protection. * @param options An object that can specify either or both * cookie name or header name. * - Cookie name default is `XSRF-TOKEN`. * - Header name default is `X-XSRF-TOKEN`. * */ static withOptions(options?: { cookieName?: string; headerName?: string; }): ModuleWithProviders; } /** * 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. * * This context is mutable and is shared between cloned requests unless explicitly specified. * * @usageNotes * * ### Usage Example * * ```typescript * // inside cache.interceptors.ts * export const IS_CACHE_ENABLED = new HttpContextToken(() => false); * * export class CacheInterceptor implements HttpInterceptor { * * intercept(req: HttpRequest, delegate: HttpHandler): Observable> { * if (req.context.get(IS_CACHE_ENABLED) === true) { * return ...; * } * return delegate.handle(req); * } * } * * // inside a service * * this.httpClient.get('/api/weather', { * context: new HttpContext().set(IS_CACHE_ENABLED, true) * }).subscribe(...); * ``` * * @publicApi */ export declare class HttpContext { private readonly map; /** * Store a value in the context. If a value is already present it will be overwritten. * * @param token The reference to an instance of `HttpContextToken`. * @param value The value to store. * * @returns A reference to itself for easy chaining. */ set(token: HttpContextToken, value: T): HttpContext; /** * Retrieve the value associated with the given token. * * @param token The reference to an instance of `HttpContextToken`. * * @returns The stored value or default if one is defined. */ get(token: HttpContextToken): T; /** * Delete the value associated with the given token. * * @param token The reference to an instance of `HttpContextToken`. * * @returns A reference to itself for easy chaining. */ delete(token: HttpContextToken): HttpContext; /** * @returns a list of tokens currently stored in the context. */ keys(): IterableIterator>; } /** * A token used to manipulate and access values stored in `HttpContext`. * * @publicApi */ export declare class HttpContextToken { readonly defaultValue: () => T; constructor(defaultValue: () => T); } /** * A download progress event. * * @publicApi */ export declare interface HttpDownloadProgressEvent extends HttpProgressEvent { type: HttpEventType.DownloadProgress; /** * The partial response body as downloaded so far. * * Only present if the responseType was `text`. */ partialText?: string; } /** * 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. * * Any error returned on the `Observable` response stream will be * wrapped in an `HttpErrorResponse` to provide additional context about * the state of the HTTP layer when the error occurred. The error property * will contain either a wrapped Error object or the error response returned * from the server. * * @publicApi */ export declare class HttpErrorResponse extends HttpResponseBase implements Error { readonly name = "HttpErrorResponse"; readonly message: string; readonly error: any | null; /** * Errors are never okay, even when the status code is in the 2xx success range. */ readonly ok = false; constructor(init: { error?: any; headers?: HttpHeaders; status?: number; statusText?: string; url?: string; }); } /** * Union type for all possible events on the response stream. * * Typed according to the expected type of the response. * * @publicApi */ export declare type HttpEvent = HttpSentEvent | HttpHeaderResponse | HttpResponse | HttpProgressEvent | HttpUserEvent; /** * Type enumeration for the different kinds of `HttpEvent`. * * @publicApi */ export declare enum HttpEventType { /** * The request was sent out over the wire. */ Sent = 0, /** * An upload progress event was received. */ UploadProgress = 1, /** * The response status code and headers were received. */ ResponseHeader = 2, /** * A download progress event was received. */ DownloadProgress = 3, /** * The full response including the body was received. */ Response = 4, /** * A custom event from an interceptor or a backend. */ User = 5 } /** * Transforms an `HttpRequest` into a stream of `HttpEvent`s, one of which will likely be a * `HttpResponse`. * * `HttpHandler` is injectable. When injected, the handler instance dispatches requests to the * first interceptor in the chain, which dispatches to the second, etc, eventually reaching the * `HttpBackend`. * * In an `HttpInterceptor`, the `HttpHandler` parameter is the next interceptor in the chain. * * @publicApi */ export declare abstract class HttpHandler { abstract handle(req: HttpRequest): Observable>; } /** * A partial HTTP response which only includes the status and header data, * but no response body. * * `HttpHeaderResponse` is a `HttpEvent` available on the response * event stream, only when progress events are requested. * * @publicApi */ export declare class HttpHeaderResponse extends HttpResponseBase { /** * Create a new `HttpHeaderResponse` with the given parameters. */ constructor(init?: { headers?: HttpHeaders; status?: number; statusText?: string; url?: string; }); readonly type: HttpEventType.ResponseHeader; /** * Copy this `HttpHeaderResponse`, overriding its contents with the * given parameter hash. */ clone(update?: { headers?: HttpHeaders; status?: number; statusText?: string; url?: string; }): HttpHeaderResponse; } /** * 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. * * @publicApi */ export declare class HttpHeaders { /** * Internal map of lowercase header names to values. */ private headers; /** * Internal map of lowercased header names to the normalized * form of the name (the form seen first). */ private normalizedNames; /** * Complete the lazy initialization of this object (needed before reading). */ private lazyInit; /** * Queued updates to be materialized the next initialization. */ private lazyUpdate; /** Constructs a new HTTP header object with the given values.*/ constructor(headers?: string | { [name: string]: string | string[]; }); /** * Checks for existence of a given header. * * @param name The header name to check for existence. * * @returns True if the header exists, false otherwise. */ has(name: string): boolean; /** * Retrieves the first value of a given header. * * @param name The header name. * * @returns The value string if the header exists, null otherwise */ get(name: string): string | null; /** * Retrieves the names of the headers. * * @returns A list of header names. */ keys(): string[]; /** * Retrieves a list of values for a given header. * * @param name The header name from which to retrieve values. * * @returns A string of values if the header exists, null otherwise. */ getAll(name: string): string[] | null; /** * Appends a new value to the existing set of values for a header * and returns them in a clone of the original instance. * * @param name The header name for which to append the values. * @param value The value to append. * * @returns A clone of the HTTP headers object with the value appended to the given header. */ append(name: string, value: string | string[]): HttpHeaders; /** * Sets or modifies a value for a given header in a clone of the original instance. * If the header already exists, its value is replaced with the given value * in the returned object. * * @param name The header name. * @param value The value or values to set or overide for the given header. * * @returns A clone of the HTTP headers object with the newly set header value. */ set(name: string, value: string | string[]): HttpHeaders; /** * Deletes values for a given header in a clone of the original instance. * * @param name The header name. * @param value The value or values to delete for the given header. * * @returns A clone of the HTTP headers object with the given value deleted. */ delete(name: string, value?: string | string[]): HttpHeaders; private maybeSetNormalizedName; private init; private copyFrom; private clone; private applyUpdate; } /** * Intercepts and handles an `HttpRequest` or `HttpResponse`. * * Most interceptors transform the outgoing request before passing it to the * next interceptor in the chain, by calling `next.handle(transformedReq)`. * An interceptor may transform the * response event stream as well, by applying additional RxJS operators on the stream * returned by `next.handle()`. * * More rarely, an interceptor may handle the request entirely, * and compose a new event stream instead of invoking `next.handle()`. This is an * acceptable behavior, but keep in mind that further interceptors will be skipped entirely. * * It is also rare but valid for an interceptor to return multiple responses on the * event stream for a single request. * * @publicApi * * @see [HTTP Guide](guide/http#intercepting-requests-and-responses) * * @usageNotes * * To use the same instance of `HttpInterceptors` for the entire app, import the `HttpClientModule` * only in your `AppModule`, and add the interceptors to the root application injector. * If you import `HttpClientModule` multiple times across different modules (for example, in lazy * loading modules), each import creates a new copy of the `HttpClientModule`, which overwrites the * interceptors provided in the root module. * */ export declare interface HttpInterceptor { /** * Identifies and handles a given HTTP request. * @param req The outgoing request object to handle. * @param next The next interceptor in the chain, or the backend * if no interceptors remain in the chain. * @returns An observable of the event stream. */ intercept(req: HttpRequest, next: HttpHandler): Observable>; } /** * A codec for encoding and decoding parameters in URLs. * * Used by `HttpParams`. * * @publicApi **/ export declare interface HttpParameterCodec { encodeKey(key: string): string; encodeValue(value: string): string; decodeKey(key: string): string; decodeValue(value: string): string; } /** * An HTTP request/response body that represents serialized parameters, * per the MIME type `application/x-www-form-urlencoded`. * * This class is immutable; all mutation operations return a new instance. * * @publicApi */ export declare class HttpParams { private map; private encoder; private updates; private cloneFrom; constructor(options?: HttpParamsOptions); /** * Reports whether the body includes one or more values for a given parameter. * @param param The parameter name. * @returns True if the parameter has one or more values, * false if it has no value or is not present. */ has(param: string): boolean; /** * Retrieves the first value for a parameter. * @param param The parameter name. * @returns The first value of the given parameter, * or `null` if the parameter is not present. */ get(param: string): string | null; /** * Retrieves all values for a parameter. * @param param The parameter name. * @returns All values in a string array, * or `null` if the parameter not present. */ getAll(param: string): string[] | null; /** * Retrieves all the parameters for this body. * @returns The parameter names in a string array. */ keys(): string[]; /** * Appends a new value to existing values for a parameter. * @param param The parameter name. * @param value The new value to add. * @return A new body with the appended value. */ append(param: string, value: string | number | boolean): HttpParams; /** * Constructs a new body with appended values for the given parameter name. * @param params parameters and values * @return A new body with the new value. */ appendAll(params: { [param: string]: string | number | boolean | ReadonlyArray; }): HttpParams; /** * Replaces the value for a parameter. * @param param The parameter name. * @param value The new value. * @return A new body with the new value. */ set(param: string, value: string | number | boolean): HttpParams; /** * Removes a given value or all values from a parameter. * @param param The parameter name. * @param value The value to remove, if provided. * @return A new body with the given value removed, or with all values * removed if no value is specified. */ delete(param: string, value?: string | number | boolean): HttpParams; /** * Serializes the body to an encoded string, where key-value pairs (separated by `=`) are * separated by `&`s. */ toString(): string; private clone; private init; } /** * Options used to construct an `HttpParams` instance. * * @publicApi */ export declare interface HttpParamsOptions { /** * String representation of the HTTP parameters in URL-query-string format. * Mutually exclusive with `fromObject`. */ fromString?: string; /** Object map of the HTTP parameters. Mutually exclusive with `fromString`. */ fromObject?: { [param: string]: string | number | boolean | ReadonlyArray; }; /** Encoding codec used to parse and serialize the parameters. */ encoder?: HttpParameterCodec; } /** * Base interface for progress events. * * @publicApi */ export declare interface HttpProgressEvent { /** * Progress event type is either upload or download. */ type: HttpEventType.DownloadProgress | HttpEventType.UploadProgress; /** * Number of bytes uploaded or downloaded. */ loaded: number; /** * Total number of bytes to upload or download. Depending on the request or * response, this may not be computable and thus may not be present. */ total?: number; } /** * An outgoing HTTP request with an optional typed body. * * `HttpRequest` represents an outgoing request, including URL, method, * headers, body, and other request configuration options. Instances should be * assumed to be immutable. To modify a `HttpRequest`, the `clone` * method should be used. * * @publicApi */ export declare class HttpRequest { readonly url: string; /** * The request body, or `null` if one isn't set. * * Bodies are not enforced to be immutable, as they can include a reference to any * user-defined data type. However, interceptors should take care to preserve * idempotence by treating them as such. */ readonly body: T | null; /** * Outgoing headers for this request. */ readonly headers: HttpHeaders; /** * Shared and mutable context that can be used by interceptors */ readonly context: HttpContext; /** * Whether this request should be made in a way that exposes progress events. * * Progress events are expensive (change detection runs on each event) and so * they should only be requested if the consumer intends to monitor them. */ readonly reportProgress: boolean; /** * Whether this request should be sent with outgoing credentials (cookies). */ readonly withCredentials: boolean; /** * The expected response type of the server. * * This is used to parse the response appropriately before returning it to * the requestee. */ readonly responseType: 'arraybuffer' | 'blob' | 'json' | 'text'; /** * The outgoing HTTP request method. */ readonly method: string; /** * Outgoing URL parameters. * * To pass a string representation of HTTP parameters in the URL-query-string format, * the `HttpParamsOptions`' `fromString` may be used. For example: * * ``` * new HttpParams({fromString: 'angular=awesome'}) * ``` */ readonly params: HttpParams; /** * The outgoing URL with all URL parameters set. */ readonly urlWithParams: string; constructor(method: 'DELETE' | 'GET' | 'HEAD' | 'JSONP' | 'OPTIONS', url: string, init?: { headers?: HttpHeaders; context?: HttpContext; reportProgress?: boolean; params?: HttpParams; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; }); constructor(method: 'POST' | 'PUT' | 'PATCH', url: string, body: T | null, init?: { headers?: HttpHeaders; context?: HttpContext; reportProgress?: boolean; params?: HttpParams; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; }); constructor(method: string, url: string, body: T | null, init?: { headers?: HttpHeaders; context?: HttpContext; reportProgress?: boolean; params?: HttpParams; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; }); /** * Transform the free-form body into a serialized format suitable for * transmission to the server. */ serializeBody(): ArrayBuffer | Blob | FormData | string | null; /** * Examine the body and attempt to infer an appropriate MIME type * for it. * * If no such type can be inferred, this method will return `null`. */ detectContentTypeHeader(): string | null; clone(): HttpRequest; clone(update: { headers?: HttpHeaders; context?: HttpContext; reportProgress?: boolean; params?: HttpParams; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; body?: T | null; method?: string; url?: string; setHeaders?: { [name: string]: string | string[]; }; setParams?: { [param: string]: string; }; }): HttpRequest; clone(update: { headers?: HttpHeaders; context?: HttpContext; reportProgress?: boolean; params?: HttpParams; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; body?: V | null; method?: string; url?: string; setHeaders?: { [name: string]: string | string[]; }; setParams?: { [param: string]: string; }; }): HttpRequest; } /** * A full HTTP response, including a typed response body (which may be `null` * if one was not returned). * * `HttpResponse` is a `HttpEvent` available on the response event * stream. * * @publicApi */ export declare class HttpResponse extends HttpResponseBase { /** * The response body, or `null` if one was not returned. */ readonly body: T | null; /** * Construct a new `HttpResponse`. */ constructor(init?: { body?: T | null; headers?: HttpHeaders; status?: number; statusText?: string; url?: string; }); readonly type: HttpEventType.Response; clone(): HttpResponse; clone(update: { headers?: HttpHeaders; status?: number; statusText?: string; url?: string; }): HttpResponse; clone(update: { body?: V | null; headers?: HttpHeaders; status?: number; statusText?: string; url?: string; }): HttpResponse; } /** * Base class for both `HttpResponse` and `HttpHeaderResponse`. * * @publicApi */ export declare abstract class HttpResponseBase { /** * All response headers. */ readonly headers: HttpHeaders; /** * Response status code. */ readonly status: number; /** * Textual description of response status code, defaults to OK. * * Do not depend on this. */ readonly statusText: string; /** * URL of the resource retrieved, or null if not available. */ readonly url: string | null; /** * Whether the status code falls in the 2xx range. */ readonly ok: boolean; /** * Type of the response, narrowed to either the full response or the header. */ readonly type: HttpEventType.Response | HttpEventType.ResponseHeader; /** * Super-constructor for all responses. * * The single parameter accepted is an initialization hash. Any properties * of the response passed there will override the default values. */ constructor(init: { headers?: HttpHeaders; status?: number; statusText?: string; url?: string; }, defaultStatus?: number, defaultStatusText?: string); } /** * 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. * * @publicApi */ export declare interface HttpSentEvent { type: HttpEventType.Sent; } /** * Http status codes. * As per https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml * @publicApi */ export declare const enum HttpStatusCode { Continue = 100, SwitchingProtocols = 101, Processing = 102, EarlyHints = 103, Ok = 200, Created = 201, Accepted = 202, NonAuthoritativeInformation = 203, NoContent = 204, ResetContent = 205, PartialContent = 206, MultiStatus = 207, AlreadyReported = 208, ImUsed = 226, MultipleChoices = 300, MovedPermanently = 301, Found = 302, SeeOther = 303, NotModified = 304, UseProxy = 305, Unused = 306, TemporaryRedirect = 307, PermanentRedirect = 308, BadRequest = 400, Unauthorized = 401, PaymentRequired = 402, Forbidden = 403, NotFound = 404, MethodNotAllowed = 405, NotAcceptable = 406, ProxyAuthenticationRequired = 407, RequestTimeout = 408, Conflict = 409, Gone = 410, LengthRequired = 411, PreconditionFailed = 412, PayloadTooLarge = 413, UriTooLong = 414, UnsupportedMediaType = 415, RangeNotSatisfiable = 416, ExpectationFailed = 417, ImATeapot = 418, MisdirectedRequest = 421, UnprocessableEntity = 422, Locked = 423, FailedDependency = 424, TooEarly = 425, UpgradeRequired = 426, PreconditionRequired = 428, TooManyRequests = 429, RequestHeaderFieldsTooLarge = 431, UnavailableForLegalReasons = 451, InternalServerError = 500, NotImplemented = 501, BadGateway = 502, ServiceUnavailable = 503, GatewayTimeout = 504, HttpVersionNotSupported = 505, VariantAlsoNegotiates = 506, InsufficientStorage = 507, LoopDetected = 508, NotExtended = 510, NetworkAuthenticationRequired = 511 } /** * An upload progress event. * * @publicApi */ export declare interface HttpUploadProgressEvent extends HttpProgressEvent { type: HttpEventType.UploadProgress; } /** * Provides encoding and decoding of URL parameter and query-string values. * * Serializes and parses URL parameter keys and values to encode and decode them. * If you pass URL query parameters without encoding, * the query parameters can be misinterpreted at the receiving end. * * * @publicApi */ export declare class HttpUrlEncodingCodec implements HttpParameterCodec { /** * Encodes a key name for a URL parameter or query-string. * @param key The key name. * @returns The encoded key name. */ encodeKey(key: string): string; /** * Encodes the value of a URL parameter or query-string. * @param value The value. * @returns The encoded value. */ encodeValue(value: string): string; /** * Decodes an encoded URL parameter or query-string key. * @param key The encoded key name. * @returns The decoded key name. */ decodeKey(key: string): string; /** * Decodes an encoded URL parameter or query-string value. * @param value The encoded value. * @returns The decoded value. */ decodeValue(value: string): string; } /** * A user-defined event. * * Grouping all custom events under this type ensures they will be handled * and forwarded by all implementations of interceptors. * * @publicApi */ export declare interface HttpUserEvent { type: HttpEventType.User; } /** * Uses `XMLHttpRequest` to send requests to a backend server. * @see `HttpHandler` * @see `JsonpClientBackend` * * @publicApi */ export declare class HttpXhrBackend implements HttpBackend { private xhrFactory; constructor(xhrFactory: XhrFactory_2); /** * Processes a request and returns a stream of response events. * @param req The request object. * @returns An observable of the response events. */ handle(req: HttpRequest): Observable>; } /** * Retrieves the current XSRF token to use with the next outgoing request. * * @publicApi */ export declare abstract class HttpXsrfTokenExtractor { /** * Get the XSRF token to use with an outgoing request. * * Will be called for every request, so the token may change between requests. */ abstract getToken(): string | null; } /** * Processes an `HttpRequest` with the JSONP method, * by performing JSONP style requests. * @see `HttpHandler` * @see `HttpXhrBackend` * * @publicApi */ export declare class JsonpClientBackend implements HttpBackend { private callbackMap; private document; /** * A resolved promise that can be used to schedule microtasks in the event handlers. */ private readonly resolvedPromise; constructor(callbackMap: ɵangular_packages_common_http_http_b, document: any); /** * Get the name of the next callback method, by incrementing the global `nextRequestId`. */ private nextCallback; /** * Processes a JSONP request and returns an event stream of the results. * @param req The request object. * @returns An observable of the response events. * */ handle(req: HttpRequest): Observable>; } /** * Identifies requests with the method JSONP and * shifts them to the `JsonpClientBackend`. * * @see `HttpInterceptor` * * @publicApi */ export declare class JsonpInterceptor { private jsonp; constructor(jsonp: JsonpClientBackend); /** * Identifies and handles a given JSONP request. * @param req The outgoing request object to handle. * @param next The next interceptor in the chain, or the backend * if no interceptors remain in the chain. * @returns An observable of the event stream. */ intercept(req: HttpRequest, next: HttpHandler): Observable>; } /** * A wrapper around the `XMLHttpRequest` constructor. * * @publicApi * @see `XhrFactory` * @deprecated * `XhrFactory` has moved, please import `XhrFactory` from `@angular/common` instead. */ export declare type XhrFactory = XhrFactory_2; /** * A wrapper around the `XMLHttpRequest` constructor. * * @publicApi * @see `XhrFactory` * @deprecated * `XhrFactory` has moved, please import `XhrFactory` from `@angular/common` instead. */ export declare const XhrFactory: typeof XhrFactory_2; export declare class ɵangular_packages_common_http_http_a implements HttpInterceptor { intercept(req: HttpRequest, next: HttpHandler): Observable>; } /** * DI token/abstract type representing a map of JSONP callbacks. * * In the browser, this should always be the `window` object. * * */ export declare abstract class ɵangular_packages_common_http_http_b { [key: string]: (data: any) => void; } /** * Factory function that determines where to store JSONP callbacks. * * Ordinarily JSONP callbacks are stored on the `window` object, but this may not exist * in test environments. In that case, callbacks are stored on an anonymous object instead. * * */ export declare function ɵangular_packages_common_http_http_c(): Object; export declare const ɵangular_packages_common_http_http_d: InjectionToken; export declare const ɵangular_packages_common_http_http_e: InjectionToken; /** * `HttpXsrfTokenExtractor` which retrieves the token from a cookie. */ export declare class ɵangular_packages_common_http_http_f implements HttpXsrfTokenExtractor { private doc; private platform; private cookieName; private lastCookieString; private lastToken; constructor(doc: any, platform: string, cookieName: string); getToken(): string | null; } /** * `HttpInterceptor` which adds an XSRF token to eligible outgoing requests. */ export declare class ɵangular_packages_common_http_http_g implements HttpInterceptor { private tokenService; private headerName; constructor(tokenService: HttpXsrfTokenExtractor, headerName: string); intercept(req: HttpRequest, next: HttpHandler): Observable>; } /** * An injectable `HttpHandler` that applies multiple interceptors * to a request before passing it to the given `HttpBackend`. * * The interceptors are loaded lazily from the injector, to allow * interceptors to themselves inject classes depending indirectly * on `HttpInterceptingHandler` itself. * @see `HttpInterceptor` */ export declare class ɵHttpInterceptingHandler implements HttpHandler { private backend; private injector; private chain; constructor(backend: HttpBackend, injector: Injector); handle(req: HttpRequest): Observable>; } export { }