@angular/common
Version:
Angular - commonly needed directives and services
1,407 lines (1,403 loc) • 126 kB
TypeScript
/**
* @license Angular v8.2.3
* (c) 2010-2019 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';
/**
* A multi-provider token that represents the array of registered
* `HttpInterceptor` objects.
*
* @publicApi
*/
export declare const HTTP_INTERCEPTORS: InjectionToken<HttpInterceptor[]>;
/**
* 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<any>): Observable<HttpEvent<any>>;
}
/**
* 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`).
*
* @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<Hero[]>{
*
* const params = new HttpParams({fromString: 'name=term'});
* return this.httpClient.request('GET', this.heroesUrl, {responseType:'json', params});
* }
* ```
* ### 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)
*
* @publicApi
*/
export declare class HttpClient {
private handler;
constructor(handler: HttpHandler);
/**
* Sends an `HTTPRequest` and returns a stream of `HTTPEvents`.
*
* @return An `Observable` of the response, with the response body as a stream of `HTTPEvents`.
*/
request<R>(req: HttpRequest<any>): Observable<HttpEvent<R>>;
/**
* 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[];
};
observe?: 'body';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'arraybuffer';
withCredentials?: boolean;
}): Observable<ArrayBuffer>;
/**
* 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[];
};
observe?: 'body';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'blob';
withCredentials?: boolean;
}): Observable<Blob>;
/**
* 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[];
};
observe?: 'body';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'text';
withCredentials?: boolean;
}): Observable<string>;
/**
* 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 `HTTPEvents` for the
* request.
*/
request(method: string, url: string, options: {
body?: any;
headers?: HttpHeaders | {
[header: string]: string | string[];
};
params?: HttpParams | {
[param: string]: string | string[];
};
observe: 'events';
reportProgress?: boolean;
responseType: 'arraybuffer';
withCredentials?: boolean;
}): Observable<HttpEvent<ArrayBuffer>>;
/**
* 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 of all `HttpEvents` 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';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'blob';
withCredentials?: boolean;
}): Observable<HttpEvent<Blob>>;
/**
* 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 `HttpEvents` for the reques,
* with the response body of type string.
*/
request(method: string, url: string, options: {
body?: any;
headers?: HttpHeaders | {
[header: string]: string | string[];
};
observe: 'events';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'text';
withCredentials?: boolean;
}): Observable<HttpEvent<string>>;
/**
* 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 `HttpEvents` for the request,
* with the response body of type `Object`.
*/
request(method: string, url: string, options: {
body?: any;
headers?: HttpHeaders | {
[header: string]: string | string[];
};
reportProgress?: boolean;
observe: 'events';
params?: HttpParams | {
[param: string]: string | string[];
};
responseType?: 'json';
withCredentials?: boolean;
}): Observable<HttpEvent<any>>;
/**
* 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 `HttpEvents` for the request,
* with the response body of type `R`.
*/
request<R>(method: string, url: string, options: {
body?: any;
headers?: HttpHeaders | {
[header: string]: string | string[];
};
reportProgress?: boolean;
observe: 'events';
params?: HttpParams | {
[param: string]: string | string[];
};
responseType?: 'json';
withCredentials?: boolean;
}): Observable<HttpEvent<R>>;
/**
* 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';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'arraybuffer';
withCredentials?: boolean;
}): Observable<HttpResponse<ArrayBuffer>>;
/**
* 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';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'blob';
withCredentials?: boolean;
}): Observable<HttpResponse<Blob>>;
/**
* 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';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'text';
withCredentials?: boolean;
}): Observable<HttpResponse<string>>;
/**
* 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[];
};
reportProgress?: boolean;
observe: 'response';
params?: HttpParams | {
[param: string]: string | string[];
};
responseType?: 'json';
withCredentials?: boolean;
}): Observable<HttpResponse<Object>>;
/**
* 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<R>(method: string, url: string, options: {
body?: any;
headers?: HttpHeaders | {
[header: string]: string | string[];
};
reportProgress?: boolean;
observe: 'response';
params?: HttpParams | {
[param: string]: string | string[];
};
responseType?: 'json';
withCredentials?: boolean;
}): Observable<HttpResponse<R>>;
/**
* 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[];
};
observe?: 'body';
params?: HttpParams | {
[param: string]: string | string[];
};
responseType?: 'json';
reportProgress?: boolean;
withCredentials?: boolean;
}): Observable<Object>;
/**
* 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<R>(method: string, url: string, options?: {
body?: any;
headers?: HttpHeaders | {
[header: string]: string | string[];
};
observe?: 'body';
params?: HttpParams | {
[param: string]: string | string[];
};
responseType?: 'json';
reportProgress?: boolean;
withCredentials?: boolean;
}): Observable<R>;
/**
* 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 reuested response, wuth body of type `any`.
*/
request(method: string, url: string, options?: {
body?: any;
headers?: HttpHeaders | {
[header: string]: string | string[];
};
params?: HttpParams | {
[param: string]: string | string[];
};
observe?: HttpObserve;
reportProgress?: boolean;
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
withCredentials?: boolean;
}): Observable<any>;
/**
* 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[];
};
observe?: 'body';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'arraybuffer';
withCredentials?: boolean;
}): Observable<ArrayBuffer>;
/**
* 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[];
};
observe?: 'body';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'blob';
withCredentials?: boolean;
}): Observable<Blob>;
/**
* 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[];
};
observe?: 'body';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'text';
withCredentials?: boolean;
}): Observable<string>;
/**
* 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 `HTTPEvents` for the request,
* with response body as an `ArrayBuffer`.
*/
delete(url: string, options: {
headers?: HttpHeaders | {
[header: string]: string | string[];
};
observe: 'events';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'arraybuffer';
withCredentials?: boolean;
}): Observable<HttpEvent<ArrayBuffer>>;
/**
* 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 `HTTPEvents` for the request, with the response body as a
* `Blob`.
*/
delete(url: string, options: {
headers?: HttpHeaders | {
[header: string]: string | string[];
};
observe: 'events';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'blob';
withCredentials?: boolean;
}): Observable<HttpEvent<Blob>>;
/**
* 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 `HTTPEvents` for the request, with the response
* body of type string.
*/
delete(url: string, options: {
headers?: HttpHeaders | {
[header: string]: string | string[];
};
observe: 'events';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'text';
withCredentials?: boolean;
}): Observable<HttpEvent<string>>;
/**
* 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 `HTTPEvents` for the request, with response body of
* type `Object`.
*/
delete(url: string, options: {
headers?: HttpHeaders | {
[header: string]: string | string[];
};
observe: 'events';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType?: 'json';
withCredentials?: boolean;
}): Observable<HttpEvent<Object>>;
/**
* 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 `HTTPEvents` for the request, with a response
* body in the requested type.
*/
delete<T>(url: string, options: {
headers?: HttpHeaders | {
[header: string]: string | string[];
};
observe: 'events';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType?: 'json';
withCredentials?: boolean;
}): Observable<HttpEvent<T>>;
/**
* 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';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'arraybuffer';
withCredentials?: boolean;
}): Observable<HttpResponse<ArrayBuffer>>;
/**
* 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';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'blob';
withCredentials?: boolean;
}): Observable<HttpResponse<Blob>>;
/**
* 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';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'text';
withCredentials?: boolean;
}): Observable<HttpResponse<string>>;
/**
* 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';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType?: 'json';
withCredentials?: boolean;
}): Observable<HttpResponse<Object>>;
/**
* 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<T>(url: string, options: {
headers?: HttpHeaders | {
[header: string]: string | string[];
};
observe: 'response';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType?: 'json';
withCredentials?: boolean;
}): Observable<HttpResponse<T>>;
/**
* 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[];
};
observe?: 'body';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType?: 'json';
withCredentials?: boolean;
}): Observable<Object>;
/**
* 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<T>(url: string, options?: {
headers?: HttpHeaders | {
[header: string]: string | string[];
};
observe?: 'body';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType?: 'json';
withCredentials?: boolean;
}): Observable<T>;
/**
* 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[];
};
observe?: 'body';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'arraybuffer';
withCredentials?: boolean;
}): Observable<ArrayBuffer>;
/**
* 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[];
};
observe?: 'body';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'blob';
withCredentials?: boolean;
}): Observable<Blob>;
/**
* 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[];
};
observe?: 'body';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'text';
withCredentials?: boolean;
}): Observable<string>;
/**
* 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 `HttpEvents` for the request, with the response
* body as an `ArrayBuffer`.
*/
get(url: string, options: {
headers?: HttpHeaders | {
[header: string]: string | string[];
};
observe: 'events';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'arraybuffer';
withCredentials?: boolean;
}): Observable<HttpEvent<ArrayBuffer>>;
/**
* 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';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'blob';
withCredentials?: boolean;
}): Observable<HttpEvent<Blob>>;
/**
* 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';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'text';
withCredentials?: boolean;
}): Observable<HttpEvent<string>>;
/**
* 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';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType?: 'json';
withCredentials?: boolean;
}): Observable<HttpEvent<Object>>;
/**
* 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<T>(url: string, options: {
headers?: HttpHeaders | {
[header: string]: string | string[];
};
observe: 'events';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType?: 'json';
withCredentials?: boolean;
}): Observable<HttpEvent<T>>;
/**
* 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';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'arraybuffer';
withCredentials?: boolean;
}): Observable<HttpResponse<ArrayBuffer>>;
/**
* 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';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'blob';
withCredentials?: boolean;
}): Observable<HttpResponse<Blob>>;
/**
* 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';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'text';
withCredentials?: boolean;
}): Observable<HttpResponse<string>>;
/**
* 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';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType?: 'json';
withCredentials?: boolean;
}): Observable<HttpResponse<Object>>;
/**
* 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<T>(url: string, options: {
headers?: HttpHeaders | {
[header: string]: string | string[];
};
observe: 'response';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType?: 'json';
withCredentials?: boolean;
}): Observable<HttpResponse<T>>;
/**
* 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[];
};
observe?: 'body';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType?: 'json';
withCredentials?: boolean;
}): Observable<Object>;
/**
* 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<T>(url: string, options?: {
headers?: HttpHeaders | {
[header: string]: string | string[];
};
observe?: 'body';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType?: 'json';
withCredentials?: boolean;
}): Observable<T>;
/**
* 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[];
};
observe?: 'body';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'arraybuffer';
withCredentials?: boolean;
}): Observable<ArrayBuffer>;
/**
* 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[];
};
observe?: 'body';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'blob';
withCredentials?: boolean;
}): Observable<Blob>;
/**
* 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[];
};
observe?: 'body';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'text';
withCredentials?: boolean;
}): Observable<string>;
/**
* 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 tall `HttpEvents` for the request,
* with the response body as an `ArrayBuffer`.
*/
head(url: string, options: {
headers?: HttpHeaders | {
[header: string]: string | string[];
};
observe: 'events';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'arraybuffer';
withCredentials?: boolean;
}): Observable<HttpEvent<ArrayBuffer>>;
/**
* 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 `HttpEvents` for the request,
* with the response body as a `Blob`.
*/
head(url: string, options: {
headers?: HttpHeaders | {
[header: string]: string | string[];
};
observe: 'events';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'blob';
withCredentials?: boolean;
}): Observable<HttpEvent<Blob>>;
/**
* 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 HttpEvents for the request, with the response body of type string.
*/
head(url: string, options: {
headers?: HttpHeaders | {
[header: string]: string | string[];
};
observe: 'events';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'text';
withCredentials?: boolean;
}): Observable<HttpEvent<string>>;
/**
* 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 `HTTPEvents` for the request, with a response body of
* type `Object`.
*/
head(url: string, options: {
headers?: HttpHeaders | {
[header: string]: string | string[];
};
observe: 'events';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType?: 'json';
withCredentials?: boolean;
}): Observable<HttpEvent<Object>>;
/**
* Constructs a `HEAD` request that interprets the body as a JSON object and
* returns the full event stream.
*
* @return An `Observable` of all the `HTTPEvents` 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<T>(url: string, options: {
headers?: HttpHeaders | {
[header: string]: string | string[];
};
observe: 'events';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType?: 'json';
withCredentials?: boolean;
}): Observable<HttpEvent<T>>;
/**
* 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';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'arraybuffer';
withCredentials?: boolean;
}): Observable<HttpResponse<ArrayBuffer>>;
/**
* 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';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'blob';
withCredentials?: boolean;
}): Observable<HttpResponse<Blob>>;
/**
* 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';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'text';
withCredentials?: boolean;
}): Observable<HttpResponse<string>>;
/**
* 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';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType?: 'json';
withCredentials?: boolean;
}): Observable<HttpResponse<Object>>;
/**
* 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 responmse body of the requested type.
*/
head<T>(url: string, options: {
headers?: HttpHeaders | {
[header: string]: string | string[];
};
observe: 'response';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType?: 'json';
withCredentials?: boolean;
}): Observable<HttpResponse<T>>;
/**
* 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[];
};
observe?: 'body';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType?: 'json';
withCredentials?: boolean;
}): Observable<Object>;
/**
* 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<T>(ur