class
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[]; }; observe?: "body" | "events" | "response"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "arraybuffer" | ... 2 more ... | "json"; withCredentials?: boolean; } = {}): Observable<any>
delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: "body" | "events" | "response"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "arraybuffer" | ... 2 more ... | "json"; withCredentials?: boolean; } = {}): Observable<any>
get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: "body" | "events" | "response"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "arraybuffer" | ... 2 more ... | "json"; withCredentials?: boolean; } = {}): Observable<any>
head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: "body" | "events" | "response"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "arraybuffer" | ... 2 more ... | "json"; withCredentials?: boolean; } = {}): Observable<any>
jsonp<T>(url: string, callbackParam: string): Observable<T>
options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: "body" | "events" | "response"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "arraybuffer" | ... 2 more ... | "json"; withCredentials?: boolean; } = {}): Observable<any>
patch(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: "body" | "events" | "response"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "arraybuffer" | ... 2 more ... | "json"; withCredentials?: boolean; } = {}): Observable<any>
post(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: "body" | "events" | "response"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "arraybuffer" | ... 2 more ... | "json"; withCredentials?: boolean; } = {}): Observable<any>
put(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: "body" | "events" | "response"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "arraybuffer" | ... 2 more ... | "json"; withCredentials?: boolean; } = {}): Observable<any>
} 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 available in the Usage Notes...
| 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. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
17 overloads...Show All Hide AllOverload #1Sends an |
req | HttpRequest |
Observable<HttpEvent<R>>: An Observable of the response, with the response body as a stream of HttpEvents.
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[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<ArrayBuffer> method | string | The HTTP method. |
url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<ArrayBuffer>: An Observable of the response, with the response body as an ArrayBuffer.
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[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<Blob> method | string | The HTTP method. |
url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<Blob>: An Observable of the response, with the response body of type Blob.
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[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<string> method | string | The HTTP method. |
url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<string>: An Observable of the response, with the response body of type string.
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[]; }; params?: HttpParams | { [param: string]: string | string[]; }; observe: "events"; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpEvent<ArrayBuffer>> method | string | The HTTP method. |
url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpEvent<ArrayBuffer>>: An Observable of the response, with the response body as an array of HttpEvents for the request.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpEvent<Blob>> method | string | The HTTP method. |
url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpEvent<Blob>>: An Observable of all HttpEvents for the request, with the response body of type Blob.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpEvent<string>> method | string | The HTTP method. |
url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpEvent<string>>: An Observable of all HttpEvents for the request, with the response body of type string.
Constructs a request which interprets the body as a JSON object and returns the full event stream.
request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; reportProgress?: boolean; observe: "events"; params?: HttpParams | { [param: string]: string | string[]; }; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpEvent<any>> method | string | The HTTP method. |
url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpEvent<any>>: An Observable of all HttpEvents for the request, with the response body of type Object.
Constructs a request which interprets the body as a JSON object and returns the full event stream.
request<R>(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; reportProgress?: boolean; observe: "events"; params?: HttpParams | { [param: string]: string | string[]; }; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpEvent<R>> method | string | The HTTP method. |
url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpEvent<R>>: An Observable of all HttpEvents for the request, with the response body of type R.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpResponse<ArrayBuffer>> method | string | The HTTP method. |
url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpResponse<ArrayBuffer>>: An Observable of the HttpResponse, with the response body as an ArrayBuffer.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpResponse<Blob>> method | string | The HTTP method. |
url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpResponse<Blob>>: An Observable of the HttpResponse, with the response body of type Blob.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpResponse<string>> method | string | The HTTP method. |
url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpResponse<string>>: An Observable of the HTTP response, with the response body of type string.
Constructs a request which interprets the body as a JSON object and returns the full HttpResponse.
request(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; reportProgress?: boolean; observe: "response"; params?: HttpParams | { [param: string]: string | string[]; }; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpResponse<Object>> method | string | The HTTP method. |
url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpResponse<Object>>: An Observable of the full HttpResponse, with the response body of type Object.
Constructs a request which interprets the body as a JSON object and returns the full HttpResponse with the response body in the requested type.
request<R>(method: string, url: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; reportProgress?: boolean; observe: "response"; params?: HttpParams | { [param: string]: string | string[]; }; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpResponse<R>> method | string | The HTTP method. |
url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpResponse<R>>: An Observable of the full HttpResponse, with the response body of type R.
Constructs a request which interprets the body as a JSON object and returns the full HttpResponse as a JSON object.
request(method: string, url: string, options?: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; responseType?: "json"; reportProgress?: boolean; withCredentials?: boolean; }): Observable<Object> method | string | The HTTP method. |
url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. Optional. Default is |
Observable<Object>: An Observable of the HttpResponse, with the response body of type Object.
Constructs a request which interprets the body as a JSON object with the response body of the requested type.
request<R>(method: string, url: string, options?: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; responseType?: "json"; reportProgress?: boolean; withCredentials?: boolean; }): Observable<R> method | string | The HTTP method. |
url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. Optional. Default is |
Observable<R>: An Observable of the HttpResponse, with the response body of type R.
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[]; }; params?: HttpParams | { [param: string]: string | string[]; }; observe?: "body" | "events" | "response"; reportProgress?: boolean; responseType?: "arraybuffer" | ... 2 more ... | "json"; withCredentials?: boolean; }): Observable<any> method | string | The HTTP method. |
url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. Optional. Default is |
Observable<any>: An Observable of the reuested response, wuth 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.
responseType value determines how a successful response body is parsed.responseType is the default json, 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.
observe value of events returns an observable of the raw HttpEvent stream, including progress events by default.observe value of response returns an observable of HttpResponse<T>, where the T parameter depends on the responseType and any optionally provided type parameter.observe value of body returns an observable of <T> with the same T body type.| delete() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Constructs an observable that, when subscribed, causes the configured | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
15 overloads...Show All Hide AllOverload #1Constructs a |
url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<ArrayBuffer>: An Observable of the response body as an ArrayBuffer.
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[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<Blob> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<Blob>: An Observable of the response body as a Blob.
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[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<string> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<string>: An Observable of the response, with the response body of type string.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpEvent<ArrayBuffer>> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpEvent<ArrayBuffer>>: An Observable of all HttpEvents for the request, with response body as an ArrayBuffer.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpEvent<Blob>> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpEvent<Blob>>: An Observable of all the HttpEvents for the request, with the response body as a Blob.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpEvent<string>> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpEvent<string>>: An Observable of all HttpEvents for the request, with the response body of type string.
Constructs a DELETE request that interprets the body as a JSON object and returns the full event stream.
delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpEvent<Object>> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpEvent<Object>>: An Observable of all HttpEvents for the request, with response body of type Object.
Constructs a DELETErequest that interprets the body as a JSON object and returns the full event stream.
delete<T>(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpEvent<T>> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpEvent<T>>: An Observable of all the HttpEvents for the request, with a response body in the requested type.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpResponse<ArrayBuffer>> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpResponse<ArrayBuffer>>: An Observable of the full HttpResponse, with the response body as an ArrayBuffer.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpResponse<Blob>> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpResponse<Blob>>: An Observable of the HttpResponse, with the response body of type Blob.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpResponse<string>> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpResponse<string>>: An Observable of the full HttpResponse, with the response body of type string.
Constructs a DELETE request the interprets the body as a JSON object and returns the full HttpResponse.
delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpResponse<Object>> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpResponse<Object>>: An Observable of the HttpResponse, with the response body of type Object.
Constructs a DELETE request that interprets the body as a JSON object and returns the full HttpResponse.
delete<T>(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpResponse<T>> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpResponse<T>>: An Observable of the HttpResponse, with the response body of the requested type.
Constructs a DELETE request that interprets the body as a JSON object and returns the response body as a JSON object.
delete(url: string, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<Object> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. Optional. Default is |
Observable<Object>: An Observable of the response, with the response body of type Object.
Constructs a DELETE request that interprets the body as a JSON object and returns the response in a given type.
delete<T>(url: string, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<T> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. Optional. Default is |
Observable<T>: An Observable of the HttpResponse, with response body in the requested type.
| get() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Constructs an observable that, when subscribed, causes the configured | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
15 overloads...Show All Hide AllOverload #1Constructs a |
url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<ArrayBuffer>: An Observable of the response, with the response body as an ArrayBuffer.
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[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<Blob> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<Blob>: An Observable of the response, with the response body as a Blob.
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[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<string> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<string>: An Observable of the response, with the response body of type string.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpEvent<ArrayBuffer>> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpEvent<ArrayBuffer>>: An Observable of all HttpEvents for the request, with the response body as an ArrayBuffer.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpEvent<Blob>> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpEvent<Blob>>: An Observable of the response, with the response body as a Blob.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpEvent<string>> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpEvent<string>>: An Observable of the response, with the response body of type string.
Constructs a GET request that interprets the body as a JSON object and returns the full event stream.
get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpEvent<Object>> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpEvent<Object>>: An Observable of the response, with the response body of type Object.
Constructs a GET request that interprets the body as a JSON object and returns the full event stream.
get<T>(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpEvent<T>> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpEvent<T>>: An Observable of the response, with a response body in the requested type.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpResponse<ArrayBuffer>> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpResponse<ArrayBuffer>>: An Observable of the HttpResponse for the request, with the response body as an ArrayBuffer.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpResponse<Blob>> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpResponse<Blob>>: An Observable of the HttpResponse for the request, with the response body as a Blob.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpResponse<string>> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpResponse<string>>: An Observable of the HttpResponse for the request, with the response body of type string.
Constructs a GET request that interprets the body as a JSON object and returns the full HttpResponse.
get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpResponse<Object>> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpResponse<Object>>: An Observable of the full HttpResponse, with the response body of type Object.
Constructs a GET request that interprets the body as a JSON object and returns the full HttpResponse.
get<T>(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpResponse<T>> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpResponse<T>>: An Observable of the full HttpResponse for the request, with a response body in the requested type.
Constructs a GET request that interprets the body as a JSON object and returns the response body as a JSON object.
get(url: string, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<Object> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. Optional. Default is |
Observable<Object>: An Observable of the response body as a JSON object.
Constructs a GET request that interprets the body as a JSON object and returns the response body in a given type.
get<T>(url: string, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<T> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. Optional. Default is |
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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
15 overloads...Show All Hide AllOverload #1Constructs a |
url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<ArrayBuffer>: An Observable of the response, with the response body as an ArrayBuffer.
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[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<Blob> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<Blob>: An Observable of the response, with the response body as a Blob.
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[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<string> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<string>: An Observable of the response, with the response body of type string.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpEvent<ArrayBuffer>> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpEvent<ArrayBuffer>>: An Observable of all HttpEvents for the request, with the response body as an ArrayBuffer.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpEvent<Blob>> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpEvent<Blob>>: An Observable of all HttpEvents for the request, with the response body as a Blob.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpEvent<string>> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpEvent<string>>: An Observable of all HttpEvents for the request, with the response body of type string.
Constructs a HEAD request that interprets the body as a JSON object and returns the full HTTP event stream.
head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpEvent<Object>> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpEvent<Object>>: An Observable of all HttpEvents for the request, with a response body of type Object.
Constructs a HEAD request that interprets the body as a JSON object and returns the full event stream.
head<T>(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpEvent<T>> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpEvent<T>>: An Observable of all the HttpEvents for the request, with a response body in the requested type.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpResponse<ArrayBuffer>> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpResponse<ArrayBuffer>>: An Observable of the HttpResponse for the request, with the response body as an ArrayBuffer.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpResponse<Blob>> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpResponse<Blob>>: An Observable of the HttpResponse for the request, with the response body as a blob.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpResponse<string>> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpResponse<string>>: An Observable of the HttpResponse for the request, with the response body of type string.
Constructs a HEAD request that interprets the body as a JSON object and returns the full HttpResponse.
head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpResponse<Object>> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpResponse<Object>>: An Observable of the HttpResponse for the request, with the response body of type Object.
Constructs a HEAD request that interprets the body as a JSON object and returns the full HttpResponse.
head<T>(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpResponse<T>> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. |
Observable<HttpResponse<T>>: An Observable of the HttpResponse for the request, with a responmse body of the requested type.
Constructs a HEAD request that interprets the body as a JSON object and returns the response body as a JSON object.
head(url: string, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<Object> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. Optional. Default is |
Observable<Object>: An Observable of the response, with the response body as a JSON object.
Constructs a HEAD request that interprets the body as a JSON object and returns the response in a given type.
head<T>(url: string, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<T> url | string | The endpoint URL. |
options | object | The HTTP options to send with the request. Optional. Default is |
Observable<T>: An Observable of the HttpResponse for the request, with a response body of the given type.
| jsonp() | ||||||
|---|---|---|---|---|---|---|
| Constructs an | ||||||
| Constructs a |
url | string | The resource URL. |
callbackParam | string | The callback function name. |
Observable<Object>: An Observable of the response object, with response body as an object.
Constructs a JSONP request for the given URL and name of the callback parameter.
jsonp<T>(url: string, callbackParam: string): Observable<T> url | string | The resource URL. |
callbackParam | string | The callback function name. You must install a suitable interceptor, such as one provided by |
Observable<T>: An Observable of the response object, with response body in the requested type.
| options() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Constructs an | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
15 overloads...Show All Hide AllOverload #1Constructs an |
url | string | The endpoint URL. |
options | object | HTTP options. |
Observable<ArrayBuffer>: An Observable of the response, with the response body as an ArrayBuffer.
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[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<Blob> url | string | The endpoint URL. |
options | object | HTTP options. |
Observable<Blob>: An Observable of the response, with the response body as a Blob.
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[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<string> url | string | The endpoint URL. |
options | object | HTTP options. |
Observable<string>: An Observable of the response, with the response body of type string.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpEvent<ArrayBuffer>> url | string | The endpoint URL. |
options | object | HTTP options. |
Observable<HttpEvent<ArrayBuffer>>: An Observable of all HttpEvents for the request, with the response body as an ArrayBuffer.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpEvent<Blob>> url | string | The endpoint URL. |
options | object | HTTP options. |
Observable<HttpEvent<Blob>>: An Observable of all HttpEvents for the request, with the response body as a Blob.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpEvent<string>> url | string | The endpoint URL. |
options | object | HTTP options. |
Observable<HttpEvent<string>>: An Observable of all the HttpEvents for the request, with the response body of type string.
Constructs an OPTIONS request that interprets the body as a JSON object and returns the full event stream.
options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpEvent<Object>> url | string | The endpoint URL. |
options | object | HTTP options. |
Observable<HttpEvent<Object>>: An Observable of all the HttpEvents for the request with the response body of type Object.
Constructs an OPTIONS request that interprets the body as a JSON object and returns the full event stream.
options<T>(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpEvent<T>> url | string | The endpoint URL. |
options | object | HTTP options. |
Observable<HttpEvent<T>>: An Observable of all the HttpEvents for the request, with a response body in the requested type.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpResponse<ArrayBuffer>> url | string | The endpoint URL. |
options | object | HTTP options. |
Observable<HttpResponse<ArrayBuffer>>: An Observable of the HttpResponse for the request, with the response body as an ArrayBuffer.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpResponse<Blob>> url | string | The endpoint URL. |
options | object | HTTP options. |
Observable<HttpResponse<Blob>>: An Observable of the HttpResponse for the request, with the response body as a Blob.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpResponse<string>> url | string | The endpoint URL. |
options | object | HTTP options. |
Observable<HttpResponse<string>>: An Observable of the HttpResponse for the request, with the response body of type string.
Constructs an OPTIONS request that interprets the body as a JSON object and returns the full HttpResponse.
options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpResponse<Object>> url | string | The endpoint URL. |
options | object | HTTP options. |
Observable<HttpResponse<Object>>: An Observable of the HttpResponse for the request, with the response body of type Object.
Constructs an OPTIONS request that interprets the body as a JSON object and returns the full HttpResponse.
options<T>(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpResponse<T>> url | string | The endpoint URL. |
options | object | HTTP options. |
Observable<HttpResponse<T>>: An Observable of the HttpResponse for the request, with a response body in the requested type.
Constructs an OPTIONS request that interprets the body as a JSON object and returns the response body as a JSON object.
options(url: string, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<Object> url | string | The endpoint URL. |
options | object | HTTP options. Optional. Default is |
Observable<Object>: An Observable of the response, with the response body as a JSON object.
Constructs an OPTIONS request that interprets the body as a JSON object and returns the response in a given type.
options<T>(url: string, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<T> url | string | The endpoint URL. |
options | object | HTTP options. Optional. Default is |
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 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
15 overloads...Show All Hide AllOverload #1Constructs a |
url | string | The endpoint URL. |
body | any | The resources to edit. |
options | object | HTTP options. |
Observable<ArrayBuffer>: An Observable of the response, with the response body as an ArrayBuffer.
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[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<Blob> url | string | The endpoint URL. |
body | any | The resources to edit. |
options | object | HTTP options. |
Observable<Blob>: An Observable of the response, with the response body as a Blob.
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[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<string> url | string | The endpoint URL. |
body | any | The resources to edit. |
options | object | HTTP options. |
Observable<string>: An Observable of the response, with a response body of type string.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpEvent<ArrayBuffer>> url | string | The endpoint URL. |
body | any | The resources to edit. |
options | object | HTTP options. |
Observable<HttpEvent<ArrayBuffer>>: An Observable of all the HttpEvents for the request, with the response body as an ArrayBuffer.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpEvent<Blob>> url | string | The endpoint URL. |
body | any | The resources to edit. |
options | object | HTTP options. |
Observable<HttpEvent<Blob>>: An Observable of all the HttpEvents for the request, with the response body as Blob.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpEvent<string>> url | string | The endpoint URL. |
body | any | The resources to edit. |
options | object | HTTP options. |
Observable<HttpEvent<string>>: An Observable of all the HttpEvents for the request, with a response body of type string.
Constructs a PATCH request that interprets the body as a JSON object and returns the full event stream.
patch(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpEvent<Object>> url | string | The endpoint URL. |
body | any | The resources to edit. |
options | object | HTTP options. |
Observable<HttpEvent<Object>>: An Observable of all the HttpEvents for the request, with a response body of type Object.
Constructs a PATCH request that interprets the body as a JSON object and returns the full event stream.
patch<T>(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpEvent<T>> url | string | The endpoint URL. |
body | any | The resources to edit. |
options | object | HTTP options. |
Observable<HttpEvent<T>>: An Observable of all the HttpEvents for the request, with a response body in the requested type.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpResponse<ArrayBuffer>> url | string | The endpoint URL. |
body | any | The resources to edit. |
options | object | HTTP options. |
Observable<HttpResponse<ArrayBuffer>>: An Observable of the HttpResponse for the request, with the response body as an ArrayBuffer.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpResponse<Blob>> url | string | The endpoint URL. |
body | any | The resources to edit. |
options | object | HTTP options. |
Observable<HttpResponse<Blob>>: An Observable of the HttpResponse for the request, with the response body as a Blob.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpResponse<string>> url | string | The endpoint URL. |
body | any | The resources to edit. |
options | object | HTTP options. |
Observable<HttpResponse<string>>: An Observable of the HttpResponse for the request, with a response body of type string.
Constructs a PATCH request that interprets the body as a JSON object and returns the full HttpResponse.
patch(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpResponse<Object>> url | string | The endpoint URL. |
body | any | The resources to edit. |
options | object | HTTP options. |
Observable<HttpResponse<Object>>: An Observable of the HttpResponse for the request, with a response body in the requested type.
Constructs a PATCH request that interprets the body as a JSON object and returns the full HttpResponse.
patch<T>(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpResponse<T>> url | string | The endpoint URL. |
body | any | The resources to edit. |
options | object | HTTP options. |
Observable<HttpResponse<T>>: An Observable of the HttpResponse for the request, with a response body in the given type.
Constructs a PATCH request that interprets the body as a JSON object and returns the response body as a JSON object.
patch(url: string, body: any, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<Object> url | string | The endpoint URL. |
body | any | The resources to edit. |
options | object | HTTP options. Optional. Default is |
Observable<Object>: An Observable of the response, with the response body as a JSON object.
Constructs a PATCH request that interprets the body as a JSON object and returns the response in a given type.
patch<T>(url: string, body: any, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<T> url | string | The endpoint URL. |
body | any | The resources to edit. |
options | object | HTTP options. Optional. Default is |
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 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
15 overloads...Show All Hide AllOverload #1Constructs a |
url | string | The endpoint URL. |
body | any | The content to replace with. |
options | object | HTTP options. |
Observable<ArrayBuffer>: An Observable of the response, with the response body as an ArrayBuffer.
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[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<Blob> url | string | The endpoint URL. |
body | any | The content to replace with. |
options | object | HTTP options |
Observable<Blob>: An Observable of the response, with the response body as a Blob.
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[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<string> url | string | The endpoint URL. |
body | any | The content to replace with. |
options | object | HTTP options |
Observable<string>: An Observable of the response, with a response body of type string.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpEvent<ArrayBuffer>> url | string | The endpoint URL. |
body | any | The content to replace with. |
options | object | HTTP options |
Observable<HttpEvent<ArrayBuffer>>: An Observable of all HttpEvents for the request, with the response body as an ArrayBuffer.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpEvent<Blob>> url | string | The endpoint URL. |
body | any | The content to replace with. |
options | object | HTTP options |
Observable<HttpEvent<Blob>>: An Observable of all HttpEvents for the request, with the response body as Blob.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpEvent<string>> url | string | The endpoint URL. |
body | any | The content to replace with. |
options | object | HTTP options |
Observable<HttpEvent<string>>: An Observable of all HttpEvents for the request, with a response body of type string.
Constructs a POST request that interprets the body as a JSON object and returns the full event stream.
post(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpEvent<Object>> url | string | The endpoint URL. |
body | any | The content to replace with. |
options | object | HTTP options |
Observable<HttpEvent<Object>>: An Observable of all HttpEvents for the request, with a response body of type Object.
Constructs a POST request that interprets the body as a JSON object and returns the full event stream.
post<T>(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpEvent<T>> url | string | The endpoint URL. |
body | any | The content to replace with. |
options | object | HTTP options |
Observable<HttpEvent<T>>: An Observable of all HttpEvents for the request, with a response body in the requested type.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpResponse<ArrayBuffer>> url | string | The endpoint URL. |
body | any | The content to replace with. |
options | object | HTTP options |
Observable<HttpResponse<ArrayBuffer>>: An Observable of the HttpResponse for the request, with the response body as an ArrayBuffer.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpResponse<Blob>> url | string | The endpoint URL. |
body | any | The content to replace with. |
options | object | HTTP options |
Observable<HttpResponse<Blob>>: An Observable of the HttpResponse for the request, with the response body as a Blob.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpResponse<string>> url | string | The endpoint URL. |
body | any | The content to replace with. |
options | object | HTTP options |
Observable<HttpResponse<string>>: An Observable of the HttpResponse for the request, with a response body of type string.
Constructs a POST request that interprets the body as a JSON object and returns the full HttpResponse.
post(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpResponse<Object>> url | string | The endpoint URL. |
body | any | The content to replace with. |
options | object | HTTP options |
Observable<HttpResponse<Object>>: An Observable of the HttpResponse for the request, with a response body of type Object.
Constructs a POST request that interprets the body as a JSON object and returns the full HttpResponse.
post<T>(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpResponse<T>> url | string | The endpoint URL. |
body | any | The content to replace with. |
options | object | HTTP options |
Observable<HttpResponse<T>>: An Observable of the HttpResponse for the request, with a response body in the requested type.
Constructs a POST request that interprets the body as a JSON object and returns the response body as a JSON object.
post(url: string, body: any, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<Object> url | string | The endpoint URL. |
body | any | The content to replace with. |
options | object | HTTP options Optional. Default is |
Observable<Object>: An Observable of the response, with the response body as a JSON object.
Constructs a POST request that interprets the body as a JSON object and returns an observable of the response.
post<T>(url: string, body: any, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<T> url | string | The endpoint URL. |
body | any | The content to replace with. |
options | object | HTTP options Optional. Default is |
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 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
15 overloads...Show All Hide AllOverload #1Constructs a |
url | string | The endpoint URL. |
body | any | The resources to add/update. |
options | object | HTTP options |
Observable<ArrayBuffer>: An Observable of the response, with the response body as an ArrayBuffer.
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[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<Blob> url | string | The endpoint URL. |
body | any | The resources to add/update. |
options | object | HTTP options |
Observable<Blob>: An Observable of the response, with the response body as a Blob.
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[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<string> url | string | The endpoint URL. |
body | any | The resources to add/update. |
options | object | HTTP options |
Observable<string>: An Observable of the response, with a response body of type string.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpEvent<ArrayBuffer>> url | string | The endpoint URL. |
body | any | The resources to add/update. |
options | object | HTTP options |
Observable<HttpEvent<ArrayBuffer>>: An Observable of all HttpEvents for the request, with the response body as an ArrayBuffer.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpEvent<Blob>> url | string | The endpoint URL. |
body | any | The resources to add/update. |
options | object | HTTP options |
Observable<HttpEvent<Blob>>: An Observable of all HttpEvents for the request, with the response body as a Blob.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpEvent<string>> url | string | The endpoint URL. |
body | any | The resources to add/update. |
options | object | HTTP options |
Observable<HttpEvent<string>>: An Observable of all HttpEvents for the request, with a response body of type string.
Constructs a PUT request that interprets the body as a JSON object and returns the full event stream.
put(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpEvent<Object>> url | string | The endpoint URL. |
body | any | The resources to add/update. |
options | object | HTTP options |
Observable<HttpEvent<Object>>: An Observable of all HttpEvents for the request, with a response body of type Object.
Constructs a PUT request that interprets the body as a JSON object and returns the full event stream.
put<T>(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "events"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpEvent<T>> url | string | The endpoint URL. |
body | any | The resources to add/update. |
options | object | HTTP options |
Observable<HttpEvent<T>>: An Observable of all HttpEvents for the request, with a response body in the requested type.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpResponse<ArrayBuffer>> url | string | The endpoint URL. |
body | any | The resources to add/update. |
options | object | HTTP options |
Observable<HttpResponse<ArrayBuffer>>: An Observable of the HttpResponse for the request, with the response body as an ArrayBuffer.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpResponse<Blob>> url | string | The endpoint URL. |
body | any | The resources to add/update. |
options | object | HTTP options |
Observable<HttpResponse<Blob>>: An Observable of the HttpResponse for the request, with the response body as a Blob.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpResponse<string>> url | string | The endpoint URL. |
body | any | The resources to add/update. |
options | object | HTTP options |
Observable<HttpResponse<string>>: An Observable of the HttpResponse for the request, with a response body of type string.
Constructs a PUT request that interprets the body as a JSON object and returns the full HTTP response.
put(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe: "response"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpResponse<Object>> url | string | The endpoint URL. |
body | any | The resources to add/update. |
options | object | HTTP options |
Observable<HttpResponse<Object>>: An Observable of the HttpResponse for the request, with a response body of type 'Object`.
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<HttpResponse<T>> url | string | The endpoint URL. |
body | any | The resources to add/update. |
options | object | HTTP options |
Observable<HttpResponse<T>>: An Observable of the HttpResponse for the request, with a response body in the requested type.
Constructs a PUT request that interprets the body as a JSON object and returns an observable of JSON object.
put(url: string, body: any, options?: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<Object> url | string | The endpoint URL. |
body | any | The resources to add/update. |
options | object | HTTP options Optional. Default is |
Observable<Object>: An Observable of the response as a JSON object.
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[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "json"; withCredentials?: boolean; }): Observable<T> url | string | The endpoint URL. |
body | any | The resources to add/update. |
options | object | HTTP options Optional. Default is |
Observable<T>: An Observable of the requested type.
Sample HTTP requests for the Tour of Heroes application.
// 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'}); requestJsonp(url, callback = 'callback') {
return this.httpClient.jsonp(this.heroesURL, callback);
} // 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')));
}
© 2010–2021 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v11.angular.io/api/common/http/HttpClient