HttpClient
Performs HTTP requests.
This service is available as an injectable class, with methods to perform HTTP requests.
Each request method has multiple signatures, and the return type varies based on
the signature that is called (mainly the values of observe
and responseType
).
class HttpClient {
request(first: string | HttpRequest<any>, url?: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body" | "events" | "response"; params?: HttpParams | { ...; }; reportProgress?: boolean; responseType?: "arraybuffer" | ... 2 more ... | "json"; withCredentials?: boolean; transferCache?: boolean | { ...... = {}): Observable<any>
request<R>(req: HttpRequest<any>): Observable<HttpEvent<R>>
request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | ... 2 more ... | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boole...): Observable<ArrayBuffer>
request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | ... 2 more ... | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; tra...): Observable<Blob>
request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | ... 2 more ... | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; tra...): Observable<string>
request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; ... 4 more ...; transferCache?: boolean | { ...; }; }): Observable<HttpEvent<ArrayBuffer>>
request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | ... 2 more ... | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; tr...): Observable<HttpEvent<Blob>>
request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | ... 2 more ... | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; tr...): Observable<HttpEvent<string>>
request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; reportProgress?: boolean; observe: "events"; params?: HttpParams | { ...; }; responseType?: "json"; withCredentials?: boolean; transferCache?: boolean | { ...; }; }): Observable<HttpEvent<any>>
request<R>(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; reportProgress?: boolean; observe: "events"; params?: HttpParams | { ...; }; responseType?: "json"; withCredentials?: boolean; transferCache?: boolean | { ...; }; }): Observable<HttpEvent<R>>
request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { ...; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; transferCache?: boolean | { ...; }; }): Observable<HttpResponse<ArrayBuffer>>
request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { ...; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; transferCache?: boolean | { ...; }; }): Observable<HttpResponse<Blob>>
request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { ...; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; transferCache?: boolean | { ...; }; }): Observable<HttpResponse<string>>
request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; reportProgress?: boolean; observe: "response"; params?: HttpParams | { ...; }; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpResponse<Object>>
request<R>(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; reportProgress?: boolean; observe: "response"; params?: HttpParams | { ...; }; responseType?: "json"; withCredentials?: boolean; transferCache?: boolean | { ...; }; }): Observable<HttpResponse<R>>
request(method: string, url: string, options?: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | ... 2 more ... | readonly (string | ... 1 more ... | boolean)[]; }; responseType?: "json"; reportProgress?: boolean; withCredentials?: boolean; tr...): Observable<Object>
request<R>(method: string, url: string, options?: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | ... 2 more ... | readonly (string | ... 1 more ... | boolean)[]; }; responseType?: "json"; reportProgress?: boolean; withCredentials?: boolean; tr...): Observable<R>
request(method: string, url: string, options?: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; ... 4 more ...; transferCache?: boolean | { ...; }; }): Observable<any>
delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body" | "events" | "response"; params?: HttpParams | { ...; }; reportProgress?: boolean; responseType?: "arraybuffer" | ... 2 more ... | "json"; withCredentials?: boolean; body?: any; } = {}): Observable<any>
delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; body?:...): Observable<ArrayBuffer>
delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; body?: any; }): Observable<Blob>
delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; body?: any; }): Observable<string>
delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; body?...): Observable<HttpEvent<ArrayBuffer>>
delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; body?: any; }): Observable<HttpEvent<Blob>>
delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; body?: any; }): Observable<HttpEvent<string>>
delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; body?: any; }): Observable<HttpEvent<Object>>
delete<T>(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; body?: any; }): Observable<HttpEvent<T>>
delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; bod...): Observable<HttpResponse<ArrayBuffer>>
delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; body?: any...): Observable<HttpResponse<Blob>>
delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; body?: any...): Observable<HttpResponse<string>>
delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; body?: an...): Observable<HttpResponse<Object>>
delete<T>(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; body?: an...): Observable<HttpResponse<T>>
delete(url: string, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; body?: any; }): Observable<Object>
delete<T>(url: string, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; body?: any; }): Observable<T>
get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body" | "events" | "response"; params?: HttpParams | { ...; }; reportProgress?: boolean; responseType?: "arraybuffer" | ... 2 more ... | "json"; withCredentials?: boolean; transferCache?: boolean | { ...; }; } = {}): Observable<any>
get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; transf...): Observable<ArrayBuffer>
get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; transferCache...): Observable<Blob>
get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; transferCache...): Observable<string>
get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; trans...): Observable<HttpEvent<ArrayBuffer>>
get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; transferCach...): Observable<HttpEvent<Blob>>
get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; transferCach...): Observable<HttpEvent<string>>
get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCac...): Observable<HttpEvent<Object>>
get<T>(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCac...): Observable<HttpEvent<T>>
get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; tra...): Observable<HttpResponse<ArrayBuffer>>
get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; transferCa...): Observable<HttpResponse<Blob>>
get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; transferCa...): Observable<HttpResponse<string>>
get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferC...): Observable<HttpResponse<Object>>
get<T>(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferC...): Observable<HttpResponse<T>>
get(url: string, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCach...): Observable<Object>
get<T>(url: string, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCach...): Observable<T>
head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body" | "events" | "response"; params?: HttpParams | { ...; }; reportProgress?: boolean; responseType?: "arraybuffer" | ... 2 more ... | "json"; withCredentials?: boolean; transferCache?: boolean | { ...; }; } = {}): Observable<any>
head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; transf...): Observable<ArrayBuffer>
head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; transferCache...): Observable<Blob>
head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; transferCache...): Observable<string>
head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; trans...): Observable<HttpEvent<ArrayBuffer>>
head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; transferCach...): Observable<HttpEvent<Blob>>
head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; transferCach...): Observable<HttpEvent<string>>
head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCac...): Observable<HttpEvent<Object>>
head<T>(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCac...): Observable<HttpEvent<T>>
head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; tra...): Observable<HttpResponse<ArrayBuffer>>
head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; transferCa...): Observable<HttpResponse<Blob>>
head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; transferCa...): Observable<HttpResponse<string>>
head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferC...): Observable<HttpResponse<Object>>
head<T>(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferC...): Observable<HttpResponse<T>>
head(url: string, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCach...): Observable<Object>
head<T>(url: string, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCach...): Observable<T>
jsonp<T>(url: string, callbackParam: string): Observable<T>
jsonp(url: string, callbackParam: string): Observable<Object>
jsonp<T>(url: string, callbackParam: string): Observable<T>
options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body" | "events" | "response"; params?: HttpParams | { ...; }; reportProgress?: boolean; responseType?: "arraybuffer" | ... 2 more ... | "json"; withCredentials?: boolean; } = {}): Observable<any>
options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<ArrayBuffer>
options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<Blob>
options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<string>
options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpEvent<ArrayBuffer>>
options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpEvent<Blob>>
options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpEvent<string>>
options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpEvent<Object>>
options<T>(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpEvent<T>>
options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpResponse<ArrayBuffer>>
options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpResponse<Blob>>
options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpResponse<string>>
options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpResponse<Object>>
options<T>(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpResponse<T>>
options(url: string, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<Object>
options<T>(url: string, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<T>
patch(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body" | "events" | "response"; params?: HttpParams | { ...; }; reportProgress?: boolean; responseType?: "arraybuffer" | ... 2 more ... | "json"; withCredentials?: boolean; } = {}): Observable<any>
patch(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<ArrayBuffer>
patch(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<Blob>
patch(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<string>
patch(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpEvent<ArrayBuffer>>
patch(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpEvent<Blob>>
patch(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpEvent<string>>
patch(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpEvent<Object>>
patch<T>(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpEvent<T>>
patch(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpResponse<ArrayBuffer>>
patch(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpResponse<Blob>>
patch(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpResponse<string>>
patch(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpResponse<Object>>
patch<T>(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpResponse<T>>
patch(url: string, body: any, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<Object>
patch<T>(url: string, body: any, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<T>
post(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body" | "events" | "response"; params?: HttpParams | { ...; }; reportProgress?: boolean; responseType?: "arraybuffer" | ... 2 more ... | "json"; withCredentials?: boolean; transferCache?: boolean | { ...; }; } = {}): Observable<any>
post(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; transf...): Observable<ArrayBuffer>
post(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; transferCache...): Observable<Blob>
post(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; transferCache...): Observable<string>
post(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; trans...): Observable<HttpEvent<ArrayBuffer>>
post(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; transferCach...): Observable<HttpEvent<Blob>>
post(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; transferCach...): Observable<HttpEvent<string>>
post(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCac...): Observable<HttpEvent<Object>>
post<T>(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCac...): Observable<HttpEvent<T>>
post(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; tra...): Observable<HttpResponse<ArrayBuffer>>
post(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; transferCa...): Observable<HttpResponse<Blob>>
post(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; transferCa...): Observable<HttpResponse<string>>
post(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferC...): Observable<HttpResponse<Object>>
post<T>(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferC...): Observable<HttpResponse<T>>
post(url: string, body: any, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCach...): Observable<Object>
post<T>(url: string, body: any, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCach...): Observable<T>
put(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body" | "events" | "response"; params?: HttpParams | { ...; }; reportProgress?: boolean; responseType?: "arraybuffer" | ... 2 more ... | "json"; withCredentials?: boolean; } = {}): Observable<any>
put(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<ArrayBuffer>
put(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<Blob>
put(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<string>
put(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpEvent<ArrayBuffer>>
put(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpEvent<Blob>>
put(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpEvent<string>>
put(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpEvent<Object>>
put<T>(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpEvent<T>>
put(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpResponse<ArrayBuffer>>
put(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpResponse<Blob>>
put(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpResponse<string>>
put(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpResponse<Object>>
put<T>(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpResponse<T>>
put(url: string, body: any, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<Object>
put<T>(url: string, body: any, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<T>
}
See also
Description
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.
Further information is available in the Usage Notes...
Methods
request() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an observable for a generic HTTP request that, when subscribed, fires the request through the chain of registered interceptors and on to the server. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
req
|
HttpRequest<any> |
Returns
Observable<HttpEvent<R>>
: An Observable
of the response, with the response body as a stream of HttpEvent
s.
Overload #2
Constructs a request that interprets the body as an ArrayBuffer
and returns the response in
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 | ... 2 more ... | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boole...): Observable<ArrayBuffer>
Parameters
method
|
string |
The HTTP method. |
url
|
string |
The endpoint URL. |
options
|
{ body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | ... 2 more ... | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boole... |
The HTTP options to send with the request. |
Returns
Observable<ArrayBuffer>
: An Observable
of the response, with the response body as an ArrayBuffer
.
Overload #3
Constructs a request that interprets the body as a blob and returns the response as a blob.
request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | ... 2 more ... | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; tra...): Observable<Blob>
Parameters
method
|
string |
The HTTP method. |
url
|
string |
The endpoint URL. |
options
|
{ body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | ... 2 more ... | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; tra... |
The HTTP options to send with the request. |
Returns
Observable<Blob>
: An Observable
of the response, with the response body of type Blob
.
Overload #4
Constructs a request that interprets the body as a text string and returns a string value.
request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | ... 2 more ... | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; tra...): Observable<string>
Parameters
method
|
string |
The HTTP method. |
url
|
string |
The endpoint URL. |
options
|
{ body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | ... 2 more ... | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; tra... |
The HTTP options to send with the request. |
Returns
Observable<string>
: An Observable
of the response, with the response body of type string.
Overload #5
Constructs a request that interprets the body as an ArrayBuffer
and returns the
the full event stream.
request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; ... 4 more ...; transferCache?: boolean | { ...; }; }): Observable<HttpEvent<ArrayBuffer>>
Parameters
method
|
string |
The HTTP method. |
url
|
string |
The endpoint URL. |
options
|
object |
The HTTP options to send with the request. |
Returns
Observable<HttpEvent<ArrayBuffer>>
: An Observable
of the response, with the response body as an array of HttpEvent
s for
the request.
Overload #6
Constructs a request that interprets the body as a Blob
and returns
the full event stream.
request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | ... 2 more ... | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; tr...): Observable<HttpEvent<Blob>>
Parameters
method
|
string |
The HTTP method. |
url
|
string |
The endpoint URL. |
options
|
{ body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | ... 2 more ... | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; tr... |
The HTTP options to send with the request. |
Returns
Observable<HttpEvent<Blob>>
: An Observable
of all HttpEvent
s for the request,
with the response body of type Blob
.
Overload #7
Constructs a request which interprets the body as a text string and returns the full event stream.
request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | ... 2 more ... | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; tr...): Observable<HttpEvent<string>>
Parameters
method
|
string |
The HTTP method. |
url
|
string |
The endpoint URL. |
options
|
{ body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | ... 2 more ... | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; tr... |
The HTTP options to send with the request. |
Returns
Observable<HttpEvent<string>>
: An Observable
of all HttpEvent
s for the request,
with the response body of type string.
Overload #8
Constructs a request which interprets the body as a JavaScript object and returns the full event stream.
request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; reportProgress?: boolean; observe: "events"; params?: HttpParams | { ...; }; responseType?: "json"; withCredentials?: boolean; transferCache?: boolean | { ...; }; }): Observable<HttpEvent<any>>
Parameters
method
|
string |
The HTTP method. |
url
|
string |
The endpoint URL. |
options
|
object |
The HTTP options to send with the request. |
Returns
Observable<HttpEvent<any>>
: An Observable
of all HttpEvent
s for the request,
with the response body of type Object
.
Overload #9
Constructs a request which interprets the body as a JavaScript object and returns the full event stream.
request<R>(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; reportProgress?: boolean; observe: "events"; params?: HttpParams | { ...; }; responseType?: "json"; withCredentials?: boolean; transferCache?: boolean | { ...; }; }): Observable<HttpEvent<R>>
Parameters
method
|
string |
The HTTP method. |
url
|
string |
The endpoint URL. |
options
|
object |
The HTTP options to send with the request. |
Returns
Observable<HttpEvent<R>>
: An Observable
of all HttpEvent
s for the request,
with the response body of type R
.
Overload #10
Constructs a request which interprets the body as an ArrayBuffer
and returns the full HttpResponse
.
request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { ...; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; transferCache?: boolean | { ...; }; }): Observable<HttpResponse<ArrayBuffer>>
Parameters
method
|
string |
The HTTP method. |
url
|
string |
The endpoint URL. |
options
|
object |
The HTTP options to send with the request. |
Returns
Observable<HttpResponse<ArrayBuffer>>
: An Observable
of the HttpResponse
, with the response body as an ArrayBuffer
.
Overload #11
Constructs a request which interprets the body as a Blob
and returns the full HttpResponse
.
request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { ...; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; transferCache?: boolean | { ...; }; }): Observable<HttpResponse<Blob>>
Parameters
method
|
string |
The HTTP method. |
url
|
string |
The endpoint URL. |
options
|
object |
The HTTP options to send with the request. |
Returns
Observable<HttpResponse<Blob>>
: An Observable
of the HttpResponse
, with the response body of type Blob
.
Overload #12
Constructs a request which interprets the body as a text stream and returns the full
HttpResponse
.
request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { ...; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; transferCache?: boolean | { ...; }; }): Observable<HttpResponse<string>>
Parameters
method
|
string |
The HTTP method. |
url
|
string |
The endpoint URL. |
options
|
object |
The HTTP options to send with the request. |
Returns
Observable<HttpResponse<string>>
: An Observable
of the HTTP response, with the response body of type string.
Overload #13
Constructs a request which interprets the body as a JavaScript object and returns the full
HttpResponse
.
request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; reportProgress?: boolean; observe: "response"; params?: HttpParams | { ...; }; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpResponse<Object>>
Parameters
method
|
string |
The HTTP method. |
url
|
string |
The endpoint URL. |
options
|
object |
The HTTP options to send with the request. |
Returns
Observable<HttpResponse<Object>>
: An Observable
of the full HttpResponse
,
with the response body of type Object
.
Overload #14
Constructs a request which interprets the body as a JavaScript object and returns
the full HttpResponse
with the response body in the requested type.
request<R>(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; reportProgress?: boolean; observe: "response"; params?: HttpParams | { ...; }; responseType?: "json"; withCredentials?: boolean; transferCache?: boolean | { ...; }; }): Observable<HttpResponse<R>>
Parameters
method
|
string |
The HTTP method. |
url
|
string |
The endpoint URL. |
options
|
object |
The HTTP options to send with the request. |
Returns
Observable<HttpResponse<R>>
: An Observable
of the full HttpResponse
, with the response body of type R
.
Overload #15
Constructs a request which interprets the body as a JavaScript object and returns the full
HttpResponse
as a JavaScript object.
request(method: string, url: string, options?: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | ... 2 more ... | readonly (string | ... 1 more ... | boolean)[]; }; responseType?: "json"; reportProgress?: boolean; withCredentials?: boolean; tr...): Observable<Object>
Parameters
method
|
string |
The HTTP method. |
url
|
string |
The endpoint URL. |
options
|
{ body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | ... 2 more ... | readonly (string | ... 1 more ... | boolean)[]; }; responseType?: "json"; reportProgress?: boolean; withCredentials?: boolean; tr... |
The HTTP options to send with the request. Optional. Default is |
Returns
Observable<Object>
: An Observable
of the HttpResponse
, with the response body of type Object
.
Overload #16
Constructs a request which interprets the body as a JavaScript object with the response body of the requested type.
request<R>(method: string, url: string, options?: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | ... 2 more ... | readonly (string | ... 1 more ... | boolean)[]; }; responseType?: "json"; reportProgress?: boolean; withCredentials?: boolean; tr...): Observable<R>
Parameters
method
|
string |
The HTTP method. |
url
|
string |
The endpoint URL. |
options
|
{ body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | ... 2 more ... | readonly (string | ... 1 more ... | boolean)[]; }; responseType?: "json"; reportProgress?: boolean; withCredentials?: boolean; tr... |
The HTTP options to send with the request. Optional. Default is |
Returns
Observable<R>
: An Observable
of the HttpResponse
, with the response body of type R
.
Overload #17
Constructs a request where response type and requested observable are not known statically.
request(method: string, url: string, options?: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; ... 4 more ...; transferCache?: boolean | { ...; }; }): Observable<any>
Parameters
method
|
string |
The HTTP method. |
url
|
string |
The endpoint URL. |
options
|
object |
The HTTP options to send with the request. Optional. Default is |
Returns
Observable<any>
: An Observable
of the requested response, with body of type any
.
You can pass an HttpRequest
directly as the only parameter. In this case,
the call returns an observable of the raw HttpEvent
stream.
Alternatively you can pass an HTTP method as the first parameter,
a URL string as the second, and an options hash containing the request body as the third.
See addBody()
. In this case, the specified responseType
and observe
options determine the
type of returned observable.
- The
responseType
value determines how a successful response body is parsed. - If
responseType
is the defaultjson
, you can pass a type interface for the resulting object as a type parameter to the call.
The observe
value determines the return type, according to what you are interested in
observing.
- An
observe
value of events returns an observable of the rawHttpEvent
stream, including progress events by default. - An
observe
value of response returns an observable ofHttpResponse<T>
, where theT
parameter depends on theresponseType
and any optionally provided type parameter. - An
observe
value of body returns an observable of<T>
with the sameT
body type.
delete() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an observable that, when subscribed, causes the configured
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; body?:... |
The HTTP options to send with the request. |
Returns
Observable<ArrayBuffer>
: An Observable
of the response body as an ArrayBuffer
.
Overload #2
Constructs a DELETE
request that interprets the body as a Blob
and returns
the response as a Blob
.
delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; body?: any; }): Observable<Blob>
Parameters
url
|
string |
The endpoint URL. |
options
|
object |
The HTTP options to send with the request. |
Returns
Observable<Blob>
: An Observable
of the response body as a Blob
.
Overload #3
Constructs a DELETE
request that interprets the body as a text string and returns
a string.
delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; body?: any; }): Observable<string>
Parameters
url
|
string |
The endpoint URL. |
options
|
object |
The HTTP options to send with the request. |
Returns
Observable<string>
: An Observable
of the response, with the response body of type string.
Overload #4
Constructs a DELETE
request that interprets the body as an ArrayBuffer
and returns the full event stream.
delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; body?...): Observable<HttpEvent<ArrayBuffer>>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; body?... |
The HTTP options to send with the request. |
Returns
Observable<HttpEvent<ArrayBuffer>>
: An Observable
of all HttpEvent
s for the request,
with response body as an ArrayBuffer
.
Overload #5
Constructs a DELETE
request that interprets the body as a Blob
and returns the full event stream.
delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; body?: any; }): Observable<HttpEvent<Blob>>
Parameters
url
|
string |
The endpoint URL. |
options
|
object |
The HTTP options to send with the request. |
Returns
Observable<HttpEvent<Blob>>
: An Observable
of all the HttpEvent
s for the request, with the response body as a
Blob
.
Overload #6
Constructs a DELETE
request that interprets the body as a text string
and returns the full event stream.
delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; body?: any; }): Observable<HttpEvent<string>>
Parameters
url
|
string |
The endpoint URL. |
options
|
object |
The HTTP options to send with the request. |
Returns
Observable<HttpEvent<string>>
: An Observable
of all HttpEvent
s for the request, with the response
body of type string.
Overload #7
Constructs a DELETE
request that interprets the body as JSON
and returns the full event stream.
delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; body?: any; }): Observable<HttpEvent<Object>>
Parameters
url
|
string |
The endpoint URL. |
options
|
object |
The HTTP options to send with the request. |
Returns
Observable<HttpEvent<Object>>
: An Observable
of all HttpEvent
s for the request, with response body of
type Object
.
Overload #8
Constructs a DELETE
request that interprets the body as JSON
and returns the full event stream.
delete<T>(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; body?: any; }): Observable<HttpEvent<T>>
Parameters
url
|
string |
The endpoint URL. |
options
|
object |
The HTTP options to send with the request. |
Returns
Observable<HttpEvent<T>>
: An Observable
of all the HttpEvent
s for the request, with a response
body in the requested type.
Overload #9
Constructs a DELETE
request that interprets the body as an ArrayBuffer
and returns
the full HttpResponse
.
delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; bod...): Observable<HttpResponse<ArrayBuffer>>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; bod... |
The HTTP options to send with the request. |
Returns
Observable<HttpResponse<ArrayBuffer>>
: An Observable
of the full HttpResponse
, with the response body as an ArrayBuffer
.
Overload #10
Constructs a DELETE
request that interprets the body as a Blob
and returns the full
HttpResponse
.
delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; body?: any...): Observable<HttpResponse<Blob>>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; body?: any... |
The HTTP options to send with the request. |
Returns
Observable<HttpResponse<Blob>>
: An Observable
of the HttpResponse
, with the response body of type Blob
.
Overload #11
Constructs a DELETE
request that interprets the body as a text stream and
returns the full HttpResponse
.
delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; body?: any...): Observable<HttpResponse<string>>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; body?: any... |
The HTTP options to send with the request. |
Returns
Observable<HttpResponse<string>>
: An Observable
of the full HttpResponse
, with the response body of type string.
Overload #12
Constructs a DELETE
request the interprets the body as a JavaScript object and returns
the full HttpResponse
.
delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; body?: an...): Observable<HttpResponse<Object>>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; body?: an... |
The HTTP options to send with the request. |
Returns
Observable<HttpResponse<Object>>
: An Observable
of the HttpResponse
, with the response body of type Object
.
Overload #13
Constructs a DELETE
request that interprets the body as JSON
and returns the full HttpResponse
.
delete<T>(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; body?: an...): Observable<HttpResponse<T>>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; body?: an... |
The HTTP options to send with the request. |
Returns
Observable<HttpResponse<T>>
: An Observable
of the HttpResponse
, with the response body of the requested type.
Overload #14
Constructs a DELETE
request that interprets the body as JSON and
returns the response body as an object parsed from JSON.
delete(url: string, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; body?: any; }): Observable<Object>
Parameters
url
|
string |
The endpoint URL. |
options
|
object |
The HTTP options to send with the request. Optional. Default is |
Returns
Observable<Object>
: An Observable
of the response, with the response body of type Object
.
Overload #15
Constructs a DELETE request that interprets the body as JSON and returns the response in a given type.
delete<T>(url: string, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; body?: any; }): Observable<T>
Parameters
url
|
string |
The endpoint URL. |
options
|
object |
The HTTP options to send with the request. Optional. Default is |
Returns
Observable<T>
: An Observable
of the HttpResponse
, with response body in the requested type.
get() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an observable that, when subscribed, causes the configured
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; transf... |
The HTTP options to send with the request. |
Returns
Observable<ArrayBuffer>
: An Observable
of the response, with the response body as an ArrayBuffer
.
Overload #2
Constructs a GET
request that interprets the body as a Blob
and returns the response as a Blob
.
get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; transferCache...): Observable<Blob>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; transferCache... |
The HTTP options to send with the request. |
Returns
Observable<Blob>
: An Observable
of the response, with the response body as a Blob
.
Overload #3
Constructs a GET
request that interprets the body as a text string
and returns the response as a string value.
get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; transferCache...): Observable<string>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; transferCache... |
The HTTP options to send with the request. |
Returns
Observable<string>
: An Observable
of the response, with the response body of type string.
Overload #4
Constructs a GET
request that interprets the body as an ArrayBuffer
and returns
the full event stream.
get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; trans...): Observable<HttpEvent<ArrayBuffer>>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; trans... |
The HTTP options to send with the request. |
Returns
Observable<HttpEvent<ArrayBuffer>>
: An Observable
of all HttpEvent
s for the request, with the response
body as an ArrayBuffer
.
Overload #5
Constructs a GET
request that interprets the body as a Blob
and
returns the full event stream.
get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; transferCach...): Observable<HttpEvent<Blob>>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; transferCach... |
The HTTP options to send with the request. |
Returns
Observable<HttpEvent<Blob>>
: An Observable
of the response, with the response body as a Blob
.
Overload #6
Constructs a GET
request that interprets the body as a text string and returns
the full event stream.
get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; transferCach...): Observable<HttpEvent<string>>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; transferCach... |
The HTTP options to send with the request. |
Returns
Observable<HttpEvent<string>>
: An Observable
of the response, with the response body of type string.
Overload #7
Constructs a GET
request that interprets the body as JSON
and returns the full event stream.
get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCac...): Observable<HttpEvent<Object>>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCac... |
The HTTP options to send with the request. |
Returns
Observable<HttpEvent<Object>>
: An Observable
of the response, with the response body of type Object
.
Overload #8
Constructs a GET
request that interprets the body as JSON and returns the full
event stream.
get<T>(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCac...): Observable<HttpEvent<T>>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCac... |
The HTTP options to send with the request. |
Returns
Observable<HttpEvent<T>>
: An Observable
of the response, with a response body in the requested type.
Overload #9
Constructs a GET
request that interprets the body as an ArrayBuffer
and
returns the full HttpResponse
.
get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; tra...): Observable<HttpResponse<ArrayBuffer>>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; tra... |
The HTTP options to send with the request. |
Returns
Observable<HttpResponse<ArrayBuffer>>
: An Observable
of the HttpResponse
for the request,
with the response body as an ArrayBuffer
.
Overload #10
Constructs a GET
request that interprets the body as a Blob
and
returns the full HttpResponse
.
get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; transferCa...): Observable<HttpResponse<Blob>>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; transferCa... |
The HTTP options to send with the request. |
Returns
Observable<HttpResponse<Blob>>
: An Observable
of the HttpResponse
for the request,
with the response body as a Blob
.
Overload #11
Constructs a GET
request that interprets the body as a text stream and
returns the full HttpResponse
.
get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; transferCa...): Observable<HttpResponse<string>>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; transferCa... |
The HTTP options to send with the request. |
Returns
Observable<HttpResponse<string>>
: An Observable
of the HttpResponse
for the request,
with the response body of type string.
Overload #12
Constructs a GET
request that interprets the body as JSON and
returns the full HttpResponse
.
get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferC...): Observable<HttpResponse<Object>>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferC... |
The HTTP options to send with the request. |
Returns
Observable<HttpResponse<Object>>
: An Observable
of the full HttpResponse
,
with the response body of type Object
.
Overload #13
Constructs a GET
request that interprets the body as JSON and
returns the full HttpResponse
.
get<T>(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferC...): Observable<HttpResponse<T>>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferC... |
The HTTP options to send with the request. |
Returns
Observable<HttpResponse<T>>
: An Observable
of the full HttpResponse
for the request,
with a response body in the requested type.
Overload #14
Constructs a GET
request that interprets the body as JSON and
returns the response body as an object parsed from JSON.
get(url: string, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCach...): Observable<Object>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCach... |
The HTTP options to send with the request. Optional. Default is |
Returns
Observable<Object>
: An Observable
of the response body as a JavaScript object.
Overload #15
Constructs a GET
request that interprets the body as JSON and returns
the response body in a given type.
get<T>(url: string, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCach...): Observable<T>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCach... |
The HTTP options to send with the request. Optional. Default is |
Returns
Observable<T>
: An Observable
of the HttpResponse
, with a response body in the requested type.
head() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an observable that, when subscribed, causes the configured
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; transf... |
The HTTP options to send with the request. |
Returns
Observable<ArrayBuffer>
: An Observable
of the response, with the response body as an ArrayBuffer
.
Overload #2
Constructs a HEAD
request that interprets the body as a Blob
and returns
the response as a Blob
.
head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; transferCache...): Observable<Blob>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; transferCache... |
The HTTP options to send with the request. |
Returns
Observable<Blob>
: An Observable
of the response, with the response body as a Blob
.
Overload #3
Constructs a HEAD
request that interprets the body as a text string and returns the response
as a string value.
head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; transferCache...): Observable<string>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; transferCache... |
The HTTP options to send with the request. |
Returns
Observable<string>
: An Observable
of the response, with the response body of type string.
Overload #4
Constructs a HEAD
request that interprets the body as an ArrayBuffer
and returns the full event stream.
head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; trans...): Observable<HttpEvent<ArrayBuffer>>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; trans... |
The HTTP options to send with the request. |
Returns
Observable<HttpEvent<ArrayBuffer>>
: An Observable
of all HttpEvent
s for the request,
with the response body as an ArrayBuffer
.
Overload #5
Constructs a HEAD
request that interprets the body as a Blob
and
returns the full event stream.
head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; transferCach...): Observable<HttpEvent<Blob>>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; transferCach... |
The HTTP options to send with the request. |
Returns
Observable<HttpEvent<Blob>>
: An Observable
of all HttpEvent
s for the request,
with the response body as a Blob
.
Overload #6
Constructs a HEAD
request that interprets the body as a text string
and returns the full event stream.
head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; transferCach...): Observable<HttpEvent<string>>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; transferCach... |
The HTTP options to send with the request. |
Returns
Observable<HttpEvent<string>>
: An Observable
of all HttpEvent
s for the request, with the response body of type
string.
Overload #7
Constructs a HEAD
request that interprets the body as JSON
and returns the full HTTP event stream.
head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCac...): Observable<HttpEvent<Object>>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCac... |
The HTTP options to send with the request. |
Returns
Observable<HttpEvent<Object>>
: An Observable
of all HttpEvent
s for the request, with a response body of
type Object
.
Overload #8
Constructs a HEAD
request that interprets the body as JSON and
returns the full event stream.
head<T>(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCac...): Observable<HttpEvent<T>>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCac... |
The HTTP options to send with the request. |
Returns
Observable<HttpEvent<T>>
: An Observable
of all the HttpEvent
s for the request,
with a response body in the requested type.
Overload #9
Constructs a HEAD
request that interprets the body as an ArrayBuffer
and returns the full HTTP response.
head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; tra...): Observable<HttpResponse<ArrayBuffer>>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; tra... |
The HTTP options to send with the request. |
Returns
Observable<HttpResponse<ArrayBuffer>>
: An Observable
of the HttpResponse
for the request,
with the response body as an ArrayBuffer
.
Overload #10
Constructs a HEAD
request that interprets the body as a Blob
and returns
the full HttpResponse
.
head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; transferCa...): Observable<HttpResponse<Blob>>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; transferCa... |
The HTTP options to send with the request. |
Returns
Observable<HttpResponse<Blob>>
: An Observable
of the HttpResponse
for the request,
with the response body as a blob.
Overload #11
Constructs a HEAD
request that interprets the body as text stream
and returns the full HttpResponse
.
head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; transferCa...): Observable<HttpResponse<string>>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; transferCa... |
The HTTP options to send with the request. |
Returns
Observable<HttpResponse<string>>
: An Observable
of the HttpResponse
for the request,
with the response body of type string.
Overload #12
Constructs a HEAD
request that interprets the body as JSON and
returns the full HttpResponse
.
head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferC...): Observable<HttpResponse<Object>>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferC... |
The HTTP options to send with the request. |
Returns
Observable<HttpResponse<Object>>
: An Observable
of the HttpResponse
for the request,
with the response body of type Object
.
Overload #13
Constructs a HEAD
request that interprets the body as JSON
and returns the full HttpResponse
.
head<T>(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferC...): Observable<HttpResponse<T>>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferC... |
The HTTP options to send with the request. |
Returns
Observable<HttpResponse<T>>
: An Observable
of the HttpResponse
for the request,
with a response body of the requested type.
Overload #14
Constructs a HEAD
request that interprets the body as JSON and
returns the response body as an object parsed from JSON.
head(url: string, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCach...): Observable<Object>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCach... |
The HTTP options to send with the request. Optional. Default is |
Returns
Observable<Object>
: An Observable
of the response, with the response body as an object parsed from JSON.
Overload #15
Constructs a HEAD
request that interprets the body as JSON and returns
the response in a given type.
head<T>(url: string, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCach...): Observable<T>
Parameters
url
|
string |
The endpoint URL. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCach... |
The HTTP options to send with the request. Optional. Default is |
Returns
Observable<T>
: An Observable
of the HttpResponse
for the request,
with a response body of the given type.
jsonp() | ||||||
---|---|---|---|---|---|---|
Constructs an |
||||||
Constructs a
Parameters
Returns
|
||||||
Constructs a
Parameters
Returns
|
options() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
url
|
string |
The endpoint URL. |
options
|
object |
HTTP options. |
Returns
Observable<ArrayBuffer>
: An Observable
of the response, with the response body as an ArrayBuffer
.
Overload #2
Constructs an OPTIONS
request that interprets the body as a Blob
and returns
the response as a Blob
.
options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<Blob>
Parameters
url
|
string |
The endpoint URL. |
options
|
object |
HTTP options. |
Returns
Observable<Blob>
: An Observable
of the response, with the response body as a Blob
.
Overload #3
Constructs an OPTIONS
request that interprets the body as a text string and
returns a string value.
options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<string>
Parameters
url
|
string |
The endpoint URL. |
options
|
object |
HTTP options. |
Returns
Observable<string>
: An Observable
of the response, with the response body of type string.
Overload #4
Constructs an OPTIONS
request that interprets the body as an ArrayBuffer
and returns the full event stream.
options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpEvent<ArrayBuffer>>
Parameters
url
|
string |
The endpoint URL. |
options
|
object |
HTTP options. |
Returns
Observable<HttpEvent<ArrayBuffer>>
: An Observable
of all HttpEvent
s for the request,
with the response body as an ArrayBuffer
.
Overload #5
Constructs an OPTIONS
request that interprets the body as a Blob
and
returns the full event stream.
options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpEvent<Blob>>
Parameters
url
|
string |
The endpoint URL. |
options
|
object |
HTTP options. |
Returns
Observable<HttpEvent<Blob>>
: An Observable
of all HttpEvent
s for the request,
with the response body as a Blob
.
Overload #6
Constructs an OPTIONS
request that interprets the body as a text string
and returns the full event stream.
options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpEvent<string>>
Parameters
url
|
string |
The endpoint URL. |
options
|
object |
HTTP options. |
Returns
Observable<HttpEvent<string>>
: An Observable
of all the HttpEvent
s for the request,
with the response body of type string.
Overload #7
Constructs an OPTIONS
request that interprets the body as JSON
and returns the full event stream.
options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpEvent<Object>>
Parameters
url
|
string |
The endpoint URL. |
options
|
object |
HTTP options. |
Returns
Observable<HttpEvent<Object>>
: An Observable
of all the HttpEvent
s for the request with the response
body of type Object
.
Overload #8
Constructs an OPTIONS
request that interprets the body as JSON and
returns the full event stream.
options<T>(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpEvent<T>>
Parameters
url
|
string |
The endpoint URL. |
options
|
object |
HTTP options. |
Returns
Observable<HttpEvent<T>>
: An Observable
of all the HttpEvent
s for the request,
with a response body in the requested type.
Overload #9
Constructs an OPTIONS
request that interprets the body as an ArrayBuffer
and returns the full HTTP response.
options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpResponse<ArrayBuffer>>
Parameters
url
|
string |
The endpoint URL. |
options
|
object |
HTTP options. |
Returns
Observable<HttpResponse<ArrayBuffer>>
: An Observable
of the HttpResponse
for the request,
with the response body as an ArrayBuffer
.
Overload #10
Constructs an OPTIONS
request that interprets the body as a Blob
and returns the full HttpResponse
.
options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpResponse<Blob>>
Parameters
url
|
string |
The endpoint URL. |
options
|
object |
HTTP options. |
Returns
Observable<HttpResponse<Blob>>
: An Observable
of the HttpResponse
for the request,
with the response body as a Blob
.
Overload #11
Constructs an OPTIONS
request that interprets the body as text stream
and returns the full HttpResponse
.
options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpResponse<string>>
Parameters
url
|
string |
The endpoint URL. |
options
|
object |
HTTP options. |
Returns
Observable<HttpResponse<string>>
: An Observable
of the HttpResponse
for the request,
with the response body of type string.
Overload #12
Constructs an OPTIONS
request that interprets the body as JSON
and returns the full HttpResponse
.
options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpResponse<Object>>
Parameters
url
|
string |
The endpoint URL. |
options
|
object |
HTTP options. |
Returns
Observable<HttpResponse<Object>>
: An Observable
of the HttpResponse
for the request,
with the response body of type Object
.
Overload #13
Constructs an OPTIONS
request that interprets the body as JSON and
returns the full HttpResponse
.
options<T>(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpResponse<T>>
Parameters
url
|
string |
The endpoint URL. |
options
|
object |
HTTP options. |
Returns
Observable<HttpResponse<T>>
: An Observable
of the HttpResponse
for the request,
with a response body in the requested type.
Overload #14
Constructs an OPTIONS
request that interprets the body as JSON and returns the
response body as an object parsed from JSON.
options(url: string, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<Object>
Parameters
url
|
string |
The endpoint URL. |
options
|
object |
HTTP options. Optional. Default is |
Returns
Observable<Object>
: An Observable
of the response, with the response body as an object parsed from JSON.
Overload #15
Constructs an OPTIONS
request that interprets the body as JSON and returns the
response in a given type.
options<T>(url: string, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<T>
Parameters
url
|
string |
The endpoint URL. |
options
|
object |
HTTP options. Optional. Default is |
Returns
Observable<T>
: An Observable
of the HttpResponse
, with a response body of the given type.
patch() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an observable that, when subscribed, causes the configured
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
url
|
string |
The endpoint URL. |
body
|
any |
The resources to edit. |
options
|
object |
HTTP options. |
Returns
Observable<ArrayBuffer>
: An Observable
of the response, with the response body as an ArrayBuffer
.
Overload #2
Constructs a PATCH
request that interprets the body as a Blob
and returns the response
as a Blob
.
patch(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<Blob>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The resources to edit. |
options
|
object |
HTTP options. |
Returns
Observable<Blob>
: An Observable
of the response, with the response body as a Blob
.
Overload #3
Constructs a PATCH
request that interprets the body as a text string and
returns the response as a string value.
patch(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<string>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The resources to edit. |
options
|
object |
HTTP options. |
Returns
Observable<string>
: An Observable
of the response, with a response body of type string.
Overload #4
Constructs a PATCH
request that interprets the body as an ArrayBuffer
and
returns the full event stream.
patch(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpEvent<ArrayBuffer>>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The resources to edit. |
options
|
object |
HTTP options. |
Returns
Observable<HttpEvent<ArrayBuffer>>
: An Observable
of all the HttpEvent
s for the request,
with the response body as an ArrayBuffer
.
Overload #5
Constructs a PATCH
request that interprets the body as a Blob
and returns the full event stream.
patch(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpEvent<Blob>>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The resources to edit. |
options
|
object |
HTTP options. |
Returns
Observable<HttpEvent<Blob>>
: An Observable
of all the HttpEvent
s for the request, with the
response body as Blob
.
Overload #6
Constructs a PATCH
request that interprets the body as a text string and
returns the full event stream.
patch(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpEvent<string>>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The resources to edit. |
options
|
object |
HTTP options. |
Returns
Observable<HttpEvent<string>>
: An Observable
of all the HttpEvent
s for the request, with a
response body of type string.
Overload #7
Constructs a PATCH
request that interprets the body as JSON
and returns the full event stream.
patch(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpEvent<Object>>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The resources to edit. |
options
|
object |
HTTP options. |
Returns
Observable<HttpEvent<Object>>
: An Observable
of all the HttpEvent
s for the request,
with a response body of type Object
.
Overload #8
Constructs a PATCH
request that interprets the body as JSON
and returns the full event stream.
patch<T>(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpEvent<T>>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The resources to edit. |
options
|
object |
HTTP options. |
Returns
Observable<HttpEvent<T>>
: An Observable
of all the HttpEvent
s for the request,
with a response body in the requested type.
Overload #9
Constructs a PATCH
request that interprets the body as an ArrayBuffer
and returns the full HttpResponse
.
patch(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpResponse<ArrayBuffer>>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The resources to edit. |
options
|
object |
HTTP options. |
Returns
Observable<HttpResponse<ArrayBuffer>>
: An Observable
of the HttpResponse
for the request,
with the response body as an ArrayBuffer
.
Overload #10
Constructs a PATCH
request that interprets the body as a Blob
and returns the full
HttpResponse
.
patch(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpResponse<Blob>>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The resources to edit. |
options
|
object |
HTTP options. |
Returns
Observable<HttpResponse<Blob>>
: An Observable
of the HttpResponse
for the request,
with the response body as a Blob
.
Overload #11
Constructs a PATCH
request that interprets the body as a text stream and returns the
full HttpResponse
.
patch(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpResponse<string>>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The resources to edit. |
options
|
object |
HTTP options. |
Returns
Observable<HttpResponse<string>>
: An Observable
of the HttpResponse
for the request,
with a response body of type string.
Overload #12
Constructs a PATCH
request that interprets the body as JSON
and returns the full HttpResponse
.
patch(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpResponse<Object>>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The resources to edit. |
options
|
object |
HTTP options. |
Returns
Observable<HttpResponse<Object>>
: An Observable
of the HttpResponse
for the request,
with a response body in the requested type.
Overload #13
Constructs a PATCH
request that interprets the body as JSON
and returns the full HttpResponse
.
patch<T>(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpResponse<T>>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The resources to edit. |
options
|
object |
HTTP options. |
Returns
Observable<HttpResponse<T>>
: An Observable
of the HttpResponse
for the request,
with a response body in the given type.
Overload #14
Constructs a PATCH
request that interprets the body as JSON and
returns the response body as an object parsed from JSON.
patch(url: string, body: any, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<Object>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The resources to edit. |
options
|
object |
HTTP options. Optional. Default is |
Returns
Observable<Object>
: An Observable
of the response, with the response body as an object parsed from JSON.
Overload #15
Constructs a PATCH
request that interprets the body as JSON
and returns the response in a given type.
patch<T>(url: string, body: any, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<T>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The resources to edit. |
options
|
object |
HTTP options. Optional. Default is |
Returns
Observable<T>
: An Observable
of the HttpResponse
for the request,
with a response body in the given type.
post() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an observable that, when subscribed, causes the configured
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
url
|
string |
The endpoint URL. |
body
|
any |
The content to replace with. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; transf... |
HTTP options. |
Returns
Observable<ArrayBuffer>
: An Observable
of the response, with the response body as an ArrayBuffer
.
Overload #2
Constructs a POST
request that interprets the body as a Blob
and returns the
response as a Blob
.
post(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; transferCache...): Observable<Blob>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The content to replace with. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; transferCache... |
HTTP options |
Returns
Observable<Blob>
: An Observable
of the response, with the response body as a Blob
.
Overload #3
Constructs a POST
request that interprets the body as a text string and
returns the response as a string value.
post(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; transferCache...): Observable<string>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The content to replace with. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; transferCache... |
HTTP options |
Returns
Observable<string>
: An Observable
of the response, with a response body of type string.
Overload #4
Constructs a POST
request that interprets the body as an ArrayBuffer
and
returns the full event stream.
post(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; trans...): Observable<HttpEvent<ArrayBuffer>>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The content to replace with. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; trans... |
HTTP options |
Returns
Observable<HttpEvent<ArrayBuffer>>
: An Observable
of all HttpEvent
s for the request,
with the response body as an ArrayBuffer
.
Overload #5
Constructs a POST
request that interprets the body as a Blob
and returns the response in an observable of the full event stream.
post(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; transferCach...): Observable<HttpEvent<Blob>>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The content to replace with. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; transferCach... |
HTTP options |
Returns
Observable<HttpEvent<Blob>>
: An Observable
of all HttpEvent
s for the request, with the response body as Blob
.
Overload #6
Constructs a POST
request that interprets the body as a text string and returns the full
event stream.
post(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; transferCach...): Observable<HttpEvent<string>>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The content to replace with. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; transferCach... |
HTTP options |
Returns
Observable<HttpEvent<string>>
: An Observable
of all HttpEvent
s for the request,
with a response body of type string.
Overload #7
Constructs a POST request that interprets the body as JSON and returns the full event stream.
post(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCac...): Observable<HttpEvent<Object>>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The content to replace with. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCac... |
HTTP options |
Returns
Observable<HttpEvent<Object>>
: An Observable
of all HttpEvent
s for the request,
with a response body of type Object
.
Overload #8
Constructs a POST request that interprets the body as JSON and returns the full event stream.
post<T>(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCac...): Observable<HttpEvent<T>>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The content to replace with. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCac... |
HTTP options |
Returns
Observable<HttpEvent<T>>
: An Observable
of all HttpEvent
s for the request,
with a response body in the requested type.
Overload #9
Constructs a POST request that interprets the body as an ArrayBuffer
and returns the full HttpResponse
.
post(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; tra...): Observable<HttpResponse<ArrayBuffer>>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The content to replace with. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; tra... |
HTTP options |
Returns
Observable<HttpResponse<ArrayBuffer>>
: An Observable
of the HttpResponse
for the request, with the response body as an
ArrayBuffer
.
Overload #10
Constructs a POST
request that interprets the body as a Blob
and returns the full
HttpResponse
.
post(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; transferCa...): Observable<HttpResponse<Blob>>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The content to replace with. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; transferCa... |
HTTP options |
Returns
Observable<HttpResponse<Blob>>
: An Observable
of the HttpResponse
for the request,
with the response body as a Blob
.
Overload #11
Constructs a POST
request that interprets the body as a text stream and returns
the full HttpResponse
.
post(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; transferCa...): Observable<HttpResponse<string>>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The content to replace with. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; transferCa... |
HTTP options |
Returns
Observable<HttpResponse<string>>
: An Observable
of the HttpResponse
for the request,
with a response body of type string.
Overload #12
Constructs a POST
request that interprets the body as JSON
and returns the full HttpResponse
.
post(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferC...): Observable<HttpResponse<Object>>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The content to replace with. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferC... |
HTTP options |
Returns
Observable<HttpResponse<Object>>
: An Observable
of the HttpResponse
for the request, with a response body of type
Object
.
Overload #13
Constructs a POST
request that interprets the body as JSON and returns the
full HttpResponse
.
post<T>(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferC...): Observable<HttpResponse<T>>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The content to replace with. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferC... |
HTTP options |
Returns
Observable<HttpResponse<T>>
: An Observable
of the HttpResponse
for the request, with a response body in the
requested type.
Overload #14
Constructs a POST
request that interprets the body as JSON
and returns the response body as an object parsed from JSON.
post(url: string, body: any, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCach...): Observable<Object>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The content to replace with. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCach... |
HTTP options Optional. Default is |
Returns
Observable<Object>
: An Observable
of the response, with the response body as an object parsed from JSON.
Overload #15
Constructs a POST
request that interprets the body as JSON
and returns an observable of the response.
post<T>(url: string, body: any, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCach...): Observable<T>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The content to replace with. |
options
|
{ headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; transferCach... |
HTTP options Optional. Default is |
Returns
Observable<T>
: An Observable
of the HttpResponse
for the request, with a response body in the
requested type.
put() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an observable that, when subscribed, causes the configured
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
url
|
string |
The endpoint URL. |
body
|
any |
The resources to add/update. |
options
|
object |
HTTP options |
Returns
Observable<ArrayBuffer>
: An Observable
of the response, with the response body as an ArrayBuffer
.
Overload #2
Constructs a PUT
request that interprets the body as a Blob
and returns
the response as a Blob
.
put(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<Blob>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The resources to add/update. |
options
|
object |
HTTP options |
Returns
Observable<Blob>
: An Observable
of the response, with the response body as a Blob
.
Overload #3
Constructs a PUT
request that interprets the body as a text string and
returns the response as a string value.
put(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<string>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The resources to add/update. |
options
|
object |
HTTP options |
Returns
Observable<string>
: An Observable
of the response, with a response body of type string.
Overload #4
Constructs a PUT
request that interprets the body as an ArrayBuffer
and
returns the full event stream.
put(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpEvent<ArrayBuffer>>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The resources to add/update. |
options
|
object |
HTTP options |
Returns
Observable<HttpEvent<ArrayBuffer>>
: An Observable
of all HttpEvent
s for the request,
with the response body as an ArrayBuffer
.
Overload #5
Constructs a PUT
request that interprets the body as a Blob
and returns the full event
stream.
put(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpEvent<Blob>>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The resources to add/update. |
options
|
object |
HTTP options |
Returns
Observable<HttpEvent<Blob>>
: An Observable
of all HttpEvent
s for the request,
with the response body as a Blob
.
Overload #6
Constructs a PUT
request that interprets the body as a text string and returns the full event
stream.
put(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpEvent<string>>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The resources to add/update. |
options
|
object |
HTTP options |
Returns
Observable<HttpEvent<string>>
: An Observable
of all HttpEvent
s for the request, with a response body
of type string.
Overload #7
Constructs a PUT
request that interprets the body as JSON and returns the full
event stream.
put(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpEvent<Object>>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The resources to add/update. |
options
|
object |
HTTP options |
Returns
Observable<HttpEvent<Object>>
: An Observable
of all HttpEvent
s for the request, with a response body of
type Object
.
Overload #8
Constructs a PUT
request that interprets the body as JSON and returns the
full event stream.
put<T>(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpEvent<T>>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The resources to add/update. |
options
|
object |
HTTP options |
Returns
Observable<HttpEvent<T>>
: An Observable
of all HttpEvent
s for the request,
with a response body in the requested type.
Overload #9
Constructs a PUT
request that interprets the body as an
ArrayBuffer
and returns an observable of the full HTTP response.
put(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpResponse<ArrayBuffer>>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The resources to add/update. |
options
|
object |
HTTP options |
Returns
Observable<HttpResponse<ArrayBuffer>>
: An Observable
of the HttpResponse
for the request, with the response body as an
ArrayBuffer
.
Overload #10
Constructs a PUT
request that interprets the body as a Blob
and returns the
full HTTP response.
put(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpResponse<Blob>>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The resources to add/update. |
options
|
object |
HTTP options |
Returns
Observable<HttpResponse<Blob>>
: An Observable
of the HttpResponse
for the request,
with the response body as a Blob
.
Overload #11
Constructs a PUT
request that interprets the body as a text stream and returns the
full HTTP response.
put(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpResponse<string>>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The resources to add/update. |
options
|
object |
HTTP options |
Returns
Observable<HttpResponse<string>>
: An Observable
of the HttpResponse
for the request, with a response body of type
string.
Overload #12
Constructs a PUT
request that interprets the body as JSON and returns the full
HTTP response.
put(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpResponse<Object>>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The resources to add/update. |
options
|
object |
HTTP options |
Returns
Observable<HttpResponse<Object>>
: An Observable
of the HttpResponse
for the request, with a response body
of type 'Object`.
Overload #13
Constructs a PUT
request that interprets the body as an instance of the requested type and
returns the full HTTP response.
put<T>(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; context?: HttpContext; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpResponse<T>>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The resources to add/update. |
options
|
object |
HTTP options |
Returns
Observable<HttpResponse<T>>
: An Observable
of the HttpResponse
for the request,
with a response body in the requested type.
Overload #14
Constructs a PUT
request that interprets the body as JSON
and returns an observable of JavaScript object.
put(url: string, body: any, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<Object>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The resources to add/update. |
options
|
object |
HTTP options Optional. Default is |
Returns
Observable<Object>
: An Observable
of the response as a JavaScript object.
Overload #15
Constructs a PUT
request that interprets the body as an instance of the requested type
and returns an observable of the requested type.
put<T>(url: string, body: any, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; context?: HttpContext; observe?: "body"; params?: HttpParams | { [param: string]: string | number | boolean | readonly (string | ... 1 more ... | boolean)[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<T>
Parameters
url
|
string |
The endpoint URL. |
body
|
any |
The resources to add/update. |
options
|
object |
HTTP options Optional. Default is |
Returns
Observable<T>
: An Observable
of the requested type.
Usage notes
Sample HTTP requests for the Tour of Heroes 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});
}
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')));
}