On this page
HttpClient
class
Performs HTTP requests.
class HttpClient {
request(first: string | HttpRequest<any>, url?: string, options: { body?: any; headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: HttpObserve; 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?: HttpObserve; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "arraybuffer" | "blob" | "text" | "json"; withCredentials?: boolean; } = {}): Observable<any>
get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: HttpObserve; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "arraybuffer" | "blob" | "text" | "json"; withCredentials?: boolean; } = {}): Observable<any>
head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: HttpObserve; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "arraybuffer" | "blob" | "text" | "json"; withCredentials?: boolean; } = {}): Observable<any>
jsonp<T>(url: string, callbackParam: string): Observable<T>
options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: HttpObserve; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "arraybuffer" | "blob" | "text" | "json"; withCredentials?: boolean; } = {}): Observable<any>
patch(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: HttpObserve; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "arraybuffer" | "blob" | "text" | "json"; withCredentials?: boolean; } = {}): Observable<any>
post(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: HttpObserve; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "arraybuffer" | "blob" | "text" | "json"; withCredentials?: boolean; } = {}): Observable<any>
put(url: string, body: any, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: HttpObserve; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: "arraybuffer" | "blob" | "text" | "json"; withCredentials?: boolean; } = {}): Observable<any>
}
See also
Description
HttpClient 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).
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. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
17 overloads...Show All Hide AllOverload #1Sends an
|
req |
HttpRequest |
Returns
Observable<HttpEvent<R>>: An Observable of the response, with the response body as a stream of HTTPEvents.
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[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<ArrayBuffer>
Parameters
method |
string |
The HTTP method. |
url |
string |
The endpoint URL. |
options |
object |
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[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<Blob>
Parameters
method |
string |
The HTTP method. |
url |
string |
The endpoint URL. |
options |
object |
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[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<string>
Parameters
method |
string |
The HTTP method. |
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 #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[]; }; params?: HttpParams | { [param: string]: string | string[]; }; observe: "events"; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: 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 HTTPEvents 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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpEvent<Blob>>
Parameters
method |
string |
The HTTP method. |
url |
string |
The endpoint URL. |
options |
object |
The HTTP options to send with the request. |
Returns
Observable<HttpEvent<Blob>>: An Observable of of all HttpEvents 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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpEvent<string>>
Parameters
method |
string |
The HTTP method. |
url |
string |
The endpoint URL. |
options |
object |
The HTTP options to send with the request. |
Returns
Observable<HttpEvent<string>>: An Observable of all HttpEvents for the reques, with the response body of type string.
Overload #8
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>>
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 HttpEvents for the request, with the response body of type Object.
Overload #9
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>>
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 HttpEvents 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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: 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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: 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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: 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 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>>
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 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>>
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 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>
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<Object>: An Observable of the HTTPResponse, with the response body of type Object.
Overload #16
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>
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<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[]; }; params?: HttpParams | { [param: string]: string | string[]; }; observe?: HttpObserve; reportProgress?: boolean; responseType?: "arraybuffer" | ... 2 more ... | "json"; withCredentials?: 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 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.
- The
responseTypevalue determines how a successful response body is parsed. - If
responseTypeis 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
observevalue of events returns an observable of the rawHttpEventstream, including progress events by default. - An
observevalue of response returns an observable ofHttpResponse<T>, where theTparameter depends on theresponseTypeand any optionally provided type parameter. - An
observevalue of body returns an observable of<T>with the sameTbody 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. |
Returns
Observable<ArrayBuffer>: An Observable of the response body as an ArrayBuffer.
Overload #2
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>
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[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): 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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpEvent<ArrayBuffer>>
Parameters
url |
string |
The endpoint URL. |
options |
object |
The HTTP options to send with the request. |
Returns
Observable<HttpEvent<ArrayBuffer>>: An Observable of all HTTPEvents 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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): 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 HTTPEvents 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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): 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 HTTPEvents for the request, with the response body of type string.
Overload #7
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>>
Parameters
url |
string |
The endpoint URL. |
options |
object |
The HTTP options to send with the request. |
Returns
Observable<HttpEvent<Object>>: An Observable of all HTTPEvents for the request, with response body of type Object.
Overload #8
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>>
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 HTTPEvents 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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpResponse<ArrayBuffer>>
Parameters
url |
string |
The endpoint URL. |
options |
object |
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpResponse<Blob>>
Parameters
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 #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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpResponse<string>>
Parameters
url |
string |
The endpoint URL. |
options |
object |
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 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>>
Parameters
url |
string |
The endpoint URL. |
options |
object |
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 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>>
Parameters
url |
string |
The endpoint URL. |
options |
object |
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 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>
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 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>
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 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
15 overloads...Show All Hide AllOverload #1Constructs a
|
url |
string |
The endpoint URL. |
options |
object |
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
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>
Parameters
url |
string |
The endpoint URL. |
options |
object |
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[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): 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 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>>
Parameters
url |
string |
The endpoint URL. |
options |
object |
The HTTP options to send with the request. |
Returns
Observable<HttpEvent<ArrayBuffer>>: An Observable of all HttpEvents 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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): 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 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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): 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 the response, with the response body of type string.
Overload #7
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>>
Parameters
url |
string |
The endpoint URL. |
options |
object |
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 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>>
Parameters
url |
string |
The endpoint URL. |
options |
object |
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpResponse<ArrayBuffer>>
Parameters
url |
string |
The endpoint URL. |
options |
object |
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpResponse<Blob>>
Parameters
url |
string |
The endpoint URL. |
options |
object |
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpResponse<string>>
Parameters
url |
string |
The endpoint URL. |
options |
object |
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 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>>
Parameters
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 #13
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>>
Parameters
url |
string |
The endpoint URL. |
options |
object |
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 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>
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 body as a JSON object.
Overload #15
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>
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 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. |
Returns
Observable<ArrayBuffer>: An Observable of the response, with the response body as an ArrayBuffer.
Overload #2
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>
Parameters
url |
string |
The endpoint URL. |
options |
object |
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[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): 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 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>>
Parameters
url |
string |
The endpoint URL. |
options |
object |
The HTTP options to send with the request. |
Returns
Observable<HttpEvent<ArrayBuffer>>: An Observable of tall HttpEvents 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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): 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 HttpEvents 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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): 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 HttpEvents for the request, with the response body of type string.
Overload #7
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>>
Parameters
url |
string |
The endpoint URL. |
options |
object |
The HTTP options to send with the request. |
Returns
Observable<HttpEvent<Object>>: An Observable of all HTTPEvents for the request, with a response body of type Object.
Overload #8
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>>
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 HTTPEvents 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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpResponse<ArrayBuffer>>
Parameters
url |
string |
The endpoint URL. |
options |
object |
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpResponse<Blob>>
Parameters
url |
string |
The endpoint URL. |
options |
object |
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpResponse<string>>
Parameters
url |
string |
The endpoint URL. |
options |
object |
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 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>>
Parameters
url |
string |
The endpoint URL. |
options |
object |
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 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>>
Parameters
url |
string |
The endpoint URL. |
options |
object |
The HTTP options to send with the request. |
Returns
Observable<HttpResponse<T>>: An Observable of the HTTPResponse for the request, with a responmse body of the requested type.
Overload #14
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>
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 as a JSON object.
Overload #15
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>
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 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. |
Returns
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>
Parameters
url |
string |
The resource URL. |
callbackParam |
string |
The callback function name. You must install a suitable interceptor, such as one provided by |
Returns
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. |
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[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; 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[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; 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"; params?: HttpParams | { [param: string]: string | string[]; }; 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 HttpEvents 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"; params?: HttpParams | { [param: string]: string | string[]; }; 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 HttpEvents 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"; params?: HttpParams | { [param: string]: string | string[]; }; 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 HTTPEvents for the request, with the response body of type string.
Overload #7
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>>
Parameters
url |
string |
The endpoint URL. |
options |
object |
HTTP options. |
Returns
Observable<HttpEvent<Object>>: An Observable of all the HttpEvents for the request with the response body of type Object.
Overload #8
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>>
Parameters
url |
string |
The endpoint URL. |
options |
object |
HTTP options. |
Returns
Observable<HttpEvent<T>>: An Observable of all the HttpEvents 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"; params?: HttpParams | { [param: string]: string | string[]; }; 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"; params?: HttpParams | { [param: string]: string | string[]; }; 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"; params?: HttpParams | { [param: string]: string | string[]; }; 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 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>>
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 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>>
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 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>
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 a JSON object.
Overload #15
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>
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 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
15 overloads...Show All Hide AllOverload #1Constructs a
|
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
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>
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 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>
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 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>>
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 HTTPevents 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"; params?: HttpParams | { [param: string]: string | string[]; }; 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 HTTPevents 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"; params?: HttpParams | { [param: string]: string | string[]; }; 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 HTTPeventsfor the request, with a response body of type string.
Overload #7
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>>
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 HTTPevents for the request, with a response body of type Object.
Overload #8
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>>
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 HTTPevents 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"; params?: HttpParams | { [param: string]: string | string[]; }; 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"; params?: HttpParams | { [param: string]: string | string[]; }; 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"; params?: HttpParams | { [param: string]: string | string[]; }; 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 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>>
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 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>>
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 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>
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 a JSON object.
Overload #15
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>
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 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
15 overloads...Show All Hide AllOverload #1Constructs a
|
url |
string |
The endpoint URL. |
body |
any |
The content to replace with. |
options |
object |
HTTP options. |
Returns
Observable<ArrayBuffer>: An Observable of the response, with the response body as an ArrayBuffer.
Overload #2
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>
Parameters
url |
string |
The endpoint URL. |
body |
any |
The content to replace with. |
options |
object |
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[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<string>
Parameters
url |
string |
The endpoint URL. |
body |
any |
The content to replace with. |
options |
object |
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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpEvent<ArrayBuffer>>
Parameters
url |
string |
The endpoint URL. |
body |
any |
The content to replace with. |
options |
object |
HTTP options |
Returns
Observable<HttpEvent<ArrayBuffer>>: An Observable of all HttpEvents 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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "blob"; withCredentials?: boolean; }): Observable<HttpEvent<Blob>>
Parameters
url |
string |
The endpoint URL. |
body |
any |
The content to replace with. |
options |
object |
HTTP options |
Returns
Observable<HttpEvent<Blob>>: An Observable of all HttpEvents 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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "text"; withCredentials?: boolean; }): Observable<HttpEvent<string>>
Parameters
url |
string |
The endpoint URL. |
body |
any |
The content to replace with. |
options |
object |
HTTP options |
Returns
Observable<HttpEvent<string>>: An Observable of all HttpEvents for the request, with a response body of type string.
Overload #7
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>>
Parameters
url |
string |
The endpoint URL. |
body |
any |
The content to replace with. |
options |
object |
HTTP options |
Returns
Observable<HttpEvent<Object>>: An Observable of all HttpEvents for the request, with a response body of type Object.
Overload #8
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>>
Parameters
url |
string |
The endpoint URL. |
body |
any |
The content to replace with. |
options |
object |
HTTP options |
Returns
Observable<HttpEvent<T>>: An Observable of all HttpEvents 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"; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: "arraybuffer"; withCredentials?: boolean; }): Observable<HttpResponse<ArrayBuffer>>
Parameters
url |
string |
The endpoint URL. |
body |
any |
The content to replace with. |
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 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>>
Parameters
url |
string |
The endpoint URL. |
body |
any |
The content to replace with. |
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 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>>
Parameters
url |
string |
The endpoint URL. |
body |
any |
The content to replace with. |
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 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>>
Parameters
url |
string |
The endpoint URL. |
body |
any |
The content to replace with. |
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 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>>
Parameters
url |
string |
The endpoint URL. |
body |
any |
The content to replace with. |
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 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>
Parameters
url |
string |
The endpoint URL. |
body |
any |
The content to replace with. |
options |
object |
HTTP options Optional. Default is |
Returns
Observable<Object>: An Observable of the response, with the response body as a JSON object.
Overload #15
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>
Parameters
url |
string |
The endpoint URL. |
body |
any |
The content to replace with. |
options |
object |
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 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
15 overloads...Show All Hide AllOverload #1Constructs a
|
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
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>
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[]; }; observe?: "body"; params?: HttpParams | { [param: string]: string | string[]; }; 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"; params?: HttpParams | { [param: string]: string | string[]; }; 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 HttpEvents 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"; params?: HttpParams | { [param: string]: string | string[]; }; 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 HttpEvents 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"; params?: HttpParams | { [param: string]: string | string[]; }; 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 HttpEvents for the request, with a response body of type string.
Overload #7
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>>
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 HttpEvents for the request, with a response body of type Object.
Overload #8
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"; 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 HttpEvents 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"; params?: HttpParams | { [param: string]: string | string[]; }; 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"; params?: HttpParams | { [param: string]: string | string[]; }; 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"; params?: HttpParams | { [param: string]: string | string[]; }; 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 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>>
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 a JSON object 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>>
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 a JSON object and returns the response body as a 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>
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, with the response body as a JSON object.
Overload #15
Constructs a PUT request that interprets the body as a JSON object and returns an observable of the response.
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>
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 HTTPResponse for the request, with a response body in 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});
}
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')));
}
© 2010–2019 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v7.angular.io/api/common/http/HttpClient