HttpClient
class
Perform HTTP requests.
class HttpClient { request(first: string | HttpRequest<any>, url?: string, options: {...}): Observable<any> delete(url: string, options: {...}): Observable<any> get(url: string, options: {...}): Observable<any> head(url: string, options: {...}): Observable<any> jsonp<T>(url: string, callbackParam: string): Observable<T> options(url: string, options: {...}): Observable<any> patch(url: string, body: any | null, options: {...}): Observable<any> post(url: string, body: any | null, options: {...}): Observable<any> put(url: string, body: any | null, options: {...}): Observable<any> }
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 according to which signature is called (mainly the values of observe
and responseType
).
Methods
request() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
req | Type: |
Returns
Observable<HttpEvent<R>>
Construct a request which interprets the body as an ArrayBuffer
and returns it.
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 | Type: |
url | Type: |
options | Type: |
Returns
Observable<ArrayBuffer>
: an Observable
of the body as an ArrayBuffer
.
Construct a request which interprets the body as a Blob
and returns it.
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 | Type: |
url | Type: |
options | Type: |
Returns
Observable<Blob>
: an Observable
of the body as a Blob
.
Construct a request which interprets the body as text and returns it.
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 | Type: |
url | Type: |
options | Type: |
Returns
Observable<string>
: an Observable
of the body as a string
.
Construct a request which interprets the body as an ArrayBuffer
and returns 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 | Type: |
url | Type: |
options | Type: |
Returns
Observable<HttpEvent<ArrayBuffer>>
: an Observable
of all HttpEvent
s for the request, with a body type of ArrayBuffer
.
Construct a request which interprets the body as an 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 | Type: |
url | Type: |
options | Type: |
Returns
Observable<HttpEvent<Blob>>
: an Observable
of all HttpEvent
s for the request, with a body type of Blob
.
Construct a request which interprets the body as text 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 | Type: |
url | Type: |
options | Type: |
Returns
Observable<HttpEvent<string>>
: an Observable
of all HttpEvent
s for the request, with a body type of string
.
Construct a request which interprets the body as JSON 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 | Type: |
url | Type: |
options | Type: |
Returns
Observable<HttpEvent<any>>
: an Observable
of all HttpEvent
s for the request, with a body type of Object
.
Construct a request which interprets the body as JSON 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 | Type: |
url | Type: |
options | Type: |
Returns
Observable<HttpEvent<R>>
: an Observable
of all HttpEvent
s for the request, with a body type of R
.
Construct a request which interprets the body as an ArrayBuffer
and returns the full response.
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 | Type: |
url | Type: |
options | Type: |
Returns
Observable<HttpResponse<ArrayBuffer>>
: an Observable
of the HttpResponse
for the request, with a body type of ArrayBuffer
.
Construct a request which interprets the body as a Blob
and returns the full response.
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 | Type: |
url | Type: |
options | Type: |
Returns
Observable<HttpResponse<Blob>>
: an Observable
of the HttpResponse
for the request, with a body type of Blob
.
Construct a request which interprets the body as text and returns the full response.
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 | Type: |
url | Type: |
options | Type: |
Returns
Observable<HttpResponse<string>>
: an Observable
of the HttpResponse
for the request, with a body type of string
.
Construct a request which interprets the body as JSON and returns the full response.
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 | Type: |
url | Type: |
options | Type: |
Returns
Observable<HttpResponse<Object>>
: an Observable
of the HttpResponse
for the request, with a body type of Object
.
Construct a request which interprets the body as JSON and returns the full response.
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 | Type: |
url | Type: |
options | Type: |
Returns
Observable<HttpResponse<R>>
: an Observable
of the HttpResponse
for the request, with a body type of R
.
Construct a request which interprets the body as JSON and returns it.
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 | Type: |
url | Type: |
options | Type: Optional. Default is |
Returns
Observable<Object>
: an Observable
of the HttpResponse
for the request, with a body type of Object
.
Construct a request which interprets the body as JSON and returns it.
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 | Type: |
url | Type: |
options | Type: Optional. Default is |
Returns
Observable<R>
: an Observable
of the HttpResponse
for the request, with a body type of R
.
Construct a request in a manner 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' | 'blob' | 'json' | 'text';
withCredentials?: boolean;
}): Observable<any>
Parameters
method | Type: |
url | Type: |
options | Type: Optional. Default is |
Returns
Observable<any>
: an Observable
of whatever was requested, typed to any
.
This method can be called in one of two ways. Either an HttpRequest
instance can be passed directly as the only parameter, or a method can be passed as the first parameter, a string URL as the second, and an options hash as the third.
If a HttpRequest
object is passed directly, an Observable
of the raw HttpEvent
stream will be returned.
If a request is instead built by providing a URL, the options object determines the return type of request()
. In addition to configuring request parameters such as the outgoing headers and/or the body, the options hash specifies two key pieces of information about the request: the responseType
and what to observe
.
The responseType
value determines how a successful response body will be parsed. If responseType
is the default json
, a type interface for the resulting object may be passed as a type parameter to request()
.
The observe
value determines the return type of request()
, based on what the consumer is interested in observing. A value of events
will return an Observable<HttpEvent>
representing the raw HttpEvent
stream, including progress events by default. A value of response
will return an Observable<HttpResponse<T>>
where the T
parameter of HttpResponse
depends on the responseType
and any optionally provided type parameter. A value of body
will return an Observable<T>
with the same T
body type.
delete() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
url | Type: |
options | Type: |
Returns
Observable<ArrayBuffer>
: an Observable
of the body as an ArrayBuffer
.
Construct a DELETE request which interprets the body as a Blob
and returns it.
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 | Type: |
options | Type: |
Returns
Observable<Blob>
: an Observable
of the body as a Blob
.
Construct a DELETE request which interprets the body as text and returns it.
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 | Type: |
options | Type: |
Returns
Observable<string>
: an Observable
of the body as a string
.
Construct a DELETE request which 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 | Type: |
options | Type: |
Returns
Observable<HttpEvent<ArrayBuffer>>
: an Observable
of all HttpEvent
s for the request, with a body type of ArrayBuffer
.
Construct a DELETE request which 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 | Type: |
options | Type: |
Returns
Observable<HttpEvent<Blob>>
: an Observable
of all HttpEvent
s for the request, with a body type of Blob
.
Construct a DELETE request which interprets the body as text 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 | Type: |
options | Type: |
Returns
Observable<HttpEvent<string>>
: an Observable
of all HttpEvent
s for the request, with a body type of string
.
Construct a DELETE request which interprets the body as JSON 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 | Type: |
options | Type: |
Returns
Observable<HttpEvent<Object>>
: an Observable
of all HttpEvent
s for the request, with a body type of Object
.
Construct a DELETE request which interprets the body as JSON 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 | Type: |
options | Type: |
Returns
Observable<HttpEvent<T>>
: an Observable
of all HttpEvent
s for the request, with a body type of T
.
Construct a DELETE request which interprets the body as an ArrayBuffer
and returns the full response.
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 | Type: |
options | Type: |
Returns
Observable<HttpResponse<ArrayBuffer>>
: an Observable
of the HttpResponse
for the request, with a body type of ArrayBuffer
.
Construct a DELETE request which interprets the body as a Blob
and returns the full response.
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 | Type: |
options | Type: |
Returns
Observable<HttpResponse<Blob>>
: an Observable
of the HttpResponse
for the request, with a body type of Blob
.
Construct a DELETE request which interprets the body as text and returns the full response.
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 | Type: |
options | Type: |
Returns
Observable<HttpResponse<string>>
: an Observable
of the HttpResponse
for the request, with a body type of string
.
Construct a DELETE request which interprets the body as JSON and returns the full response.
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 | Type: |
options | Type: |
Returns
Observable<HttpResponse<Object>>
: an Observable
of the HttpResponse
for the request, with a body type of Object
.
Construct a DELETE request which interprets the body as JSON and returns the full response.
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 | Type: |
options | Type: |
Returns
Observable<HttpResponse<T>>
: an Observable
of the HttpResponse
for the request, with a body type of T
.
Construct a DELETE request which interprets the body as JSON and returns it.
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 | Type: |
options | Type: Optional. Default is |
Returns
Observable<Object>
: an Observable
of the body as an Object
.
Construct a DELETE request which interprets the body as JSON and returns it.
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 | Type: |
options | Type: Optional. Default is |
Returns
Observable<T>
: an Observable
of the body as type T
.
get() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
url | Type: |
options | Type: |
Returns
Observable<ArrayBuffer>
: an Observable
of the body as an ArrayBuffer
.
Construct a GET request which interprets the body as a Blob
and returns it.
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 | Type: |
options | Type: |
Returns
Observable<Blob>
: an Observable
of the body as a Blob
.
Construct a GET request which interprets the body as text and returns it.
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 | Type: |
options | Type: |
Returns
Observable<string>
: an Observable
of the body as a string
.
Construct a GET request which 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 | Type: |
options | Type: |
Returns
Observable<HttpEvent<ArrayBuffer>>
: an Observable
of all HttpEvent
s for the request, with a body type of ArrayBuffer
.
Construct a GET request which 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 | Type: |
options | Type: |
Returns
Observable<HttpEvent<Blob>>
: an Observable
of all HttpEvent
s for the request, with a body type of Blob
.
Construct a GET request which interprets the body as text 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 | Type: |
options | Type: |
Returns
Observable<HttpEvent<string>>
: an Observable
of all HttpEvent
s for the request, with a body type of string
.
Construct a GET request which interprets the body as JSON 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 | Type: |
options | Type: |
Returns
Observable<HttpEvent<Object>>
: an Observable
of all HttpEvent
s for the request, with a body type of Object
.
Construct a GET request which interprets the body as JSON 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 | Type: |
options | Type: |
Returns
Observable<HttpEvent<T>>
: an Observable
of all HttpEvent
s for the request, with a body type of T
.
Construct a GET request which interprets the body as an ArrayBuffer
and returns the full response.
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 | Type: |
options | Type: |
Returns
Observable<HttpResponse<ArrayBuffer>>
: an Observable
of the HttpResponse
for the request, with a body type of ArrayBuffer
.
Construct a GET request which interprets the body as a Blob
and returns the full response.
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 | Type: |
options | Type: |
Returns
Observable<HttpResponse<Blob>>
: an Observable
of the HttpResponse
for the request, with a body type of Blob
.
Construct a GET request which interprets the body as text and returns the full response.
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 | Type: |
options | Type: |
Returns
Observable<HttpResponse<string>>
: an Observable
of the HttpResponse
for the request, with a body type of string
.
Construct a GET request which interprets the body as JSON and returns the full response.
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 | Type: |
options | Type: |
Returns
Observable<HttpResponse<Object>>
: an Observable
of the HttpResponse
for the request, with a body type of Object
.
Construct a GET request which interprets the body as JSON and returns the full response.
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 | Type: |
options | Type: |
Returns
Observable<HttpResponse<T>>
: an Observable
of the HttpResponse
for the request, with a body type of T
.
Construct a GET request which interprets the body as JSON and returns it.
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 | Type: |
options | Type: Optional. Default is |
Returns
Observable<Object>
: an Observable
of the body as an Object
.
Construct a GET request which interprets the body as JSON and returns it.
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 | Type: |
options | Type: Optional. Default is |
Returns
Observable<T>
: an Observable
of the body as type T
.
head() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
url | Type: |
options | Type: |
Returns
Observable<ArrayBuffer>
: an Observable
of the body as an ArrayBuffer
.
head(url: string, options: {
headers?: HttpHeaders | {
[header: string]: string | string[];
};
observe?: 'body';
params?: HttpParams | {
[param: string]: string | string[];
};
reportProgress?: boolean;
responseType: 'blob';
withCredentials?: boolean;
}): Observable<Blob>
Parameters
url | Type: |
options | Type: |
Returns
Observable<Blob>
Construct a HEAD request which interprets the body as text and returns it.
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 | Type: |
options | Type: |
Returns
Observable<string>
: an Observable
of the body as a string
.
Construct a HEAD request which 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 | Type: |
options | Type: |
Returns
Observable<HttpEvent<ArrayBuffer>>
: an Observable
of all HttpEvent
s for the request, with a body type of ArrayBuffer
.
Construct a HEAD request which 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 | Type: |
options | Type: |
Returns
Observable<HttpEvent<Blob>>
: an Observable
of all HttpEvent
s for the request, with a body type of Blob
.
Construct a HEAD request which interprets the body as text 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 | Type: |
options | Type: |
Returns
Observable<HttpEvent<string>>
: an Observable
of all HttpEvent
s for the request, with a body type of string
.
Construct a HEAD request which interprets the body as JSON 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?: 'json';
withCredentials?: boolean;
}): Observable<HttpEvent<Object>>
Parameters
url | Type: |
options | Type: |
Returns
Observable<HttpEvent<Object>>
: an Observable
of all HttpEvent
s for the request, with a body type of Object
.
Construct a HEAD request which interprets the body as JSON 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 | Type: |
options | Type: |
Returns
Observable<HttpEvent<T>>
: an Observable
of all HttpEvent
s for the request, with a body type of T
.
Construct a HEAD request which interprets the body as an ArrayBuffer
and returns the full 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 | Type: |
options | Type: |
Returns
Observable<HttpResponse<ArrayBuffer>>
: an Observable
of the HttpResponse
for the request, with a body type of ArrayBuffer
.
Construct a HEAD request which interprets the body as a Blob
and returns the full response.
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 | Type: |
options | Type: |
Returns
Observable<HttpResponse<Blob>>
: an Observable
of the HttpResponse
for the request, with a body type of Blob
.
Construct a HEAD request which interprets the body as text and returns the full response.
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 | Type: |
options | Type: |
Returns
Observable<HttpResponse<string>>
: an Observable
of the HttpResponse
for the request, with a body type of string
.
Construct a HEAD request which interprets the body as JSON and returns the full response.
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 | Type: |
options | Type: |
Returns
Observable<HttpResponse<Object>>
: an Observable
of the HttpResponse
for the request, with a body type of Object
.
Construct a HEAD request which interprets the body as JSON and returns the full response.
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 | Type: |
options | Type: |
Returns
Observable<HttpResponse<T>>
: an Observable
of the HttpResponse
for the request, with a body type of T
.
Construct a HEAD request which interprets the body as JSON and returns it.
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 | Type: |
options | Type: Optional. Default is |
Returns
Observable<Object>
: an Observable
of the body as an Object
.
Construct a HEAD request which interprets the body as JSON and returns it.
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 | Type: |
options | Type: Optional. Default is |
Returns
Observable<T>
: an Observable
of the body as type T
.
jsonp() | ||||
---|---|---|---|---|
Constructs an | ||||
Construct a JSONP request for the given URL and name of the callback parameter. |
url | Type: |
callbackParam | Type: |
Returns
Observable<Object>
: an Observable
of the response object as an Object
Construct a JSONP request for the given URL and name of the callback parameter.
jsonp<T>(url: string, callbackParam: string): Observable<T>
Parameters
url | Type: |
callbackParam | Type: |
Returns
Observable<T>
: an Observable
of the response object as type T
.
A suitable interceptor must be installed (e.g. via the HttpClientJsonpModule
). If no such interceptor is reached, then the JSONP
request will likely be rejected by the configured backend.
options() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
url | Type: |
options | Type: |
Returns
Observable<ArrayBuffer>
: an Observable
of the body as an ArrayBuffer
.
Construct an OPTIONS request which interprets the body as a Blob
and returns it.
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 | Type: |
options | Type: |
Returns
Observable<Blob>
: an Observable
of the body as a Blob
.
Construct an OPTIONS request which interprets the body as text and returns it.
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 | Type: |
options | Type: |
Returns
Observable<string>
: an Observable
of the body as a string
.
Construct an OPTIONS request which 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 | Type: |
options | Type: |
Returns
Observable<HttpEvent<ArrayBuffer>>
: an Observable
of all HttpEvent
s for the request, with a body type of ArrayBuffer
.
Construct an OPTIONS request which 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 | Type: |
options | Type: |
Returns
Observable<HttpEvent<Blob>>
: an Observable
of all HttpEvent
s for the request, with a body type of Blob
.
Construct an OPTIONS request which interprets the body as text 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 | Type: |
options | Type: |
Returns
Observable<HttpEvent<string>>
: an Observable
of all HttpEvent
s for the request, with a body type of string
.
Construct an OPTIONS request which interprets the body as JSON 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 | Type: |
options | Type: |
Returns
Observable<HttpEvent<Object>>
: an Observable
of all HttpEvent
s for the request, with a body type of Object
.
Construct an OPTIONS request which interprets the body as JSON 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 | Type: |
options | Type: |
Returns
Observable<HttpEvent<T>>
: an Observable
of all HttpEvent
s for the request, with a body type of T
.
Construct an OPTIONS request which interprets the body as an ArrayBuffer
and returns the full 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 | Type: |
options | Type: |
Returns
Observable<HttpResponse<ArrayBuffer>>
: an Observable
of the HttpResponse
for the request, with a body type of ArrayBuffer
.
Construct an OPTIONS request which interprets the body as a Blob
and returns the full response.
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 | Type: |
options | Type: |
Returns
Observable<HttpResponse<Blob>>
: an Observable
of the HttpResponse
for the request, with a body type of Blob
.
Construct an OPTIONS request which interprets the body as text and returns the full response.
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 | Type: |
options | Type: |
Returns
Observable<HttpResponse<string>>
: an Observable
of the HttpResponse
for the request, with a body type of string
.
Construct an OPTIONS request which interprets the body as JSON and returns the full response.
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 | Type: |
options | Type: |
Returns
Observable<HttpResponse<Object>>
: an Observable
of the HttpResponse
for the request, with a body type of Object
.
Construct an OPTIONS request which interprets the body as JSON and returns the full response.
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 | Type: |
options | Type: |
Returns
Observable<HttpResponse<T>>
: an Observable
of the HttpResponse
for the request, with a body type of T
.
Construct an OPTIONS request which interprets the body as JSON and returns it.
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 | Type: |
options | Type: Optional. Default is |
Returns
Observable<Object>
: an Observable
of the body as an Object
.
Construct an OPTIONS request which interprets the body as JSON and returns it.
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 | Type: |
options | Type: Optional. Default is |
Returns
Observable<T>
: an Observable
of the body as type T
.
patch() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
url | Type: |
body | Type: |
options | Type: |
Returns
Observable<ArrayBuffer>
: an Observable
of the body as an ArrayBuffer
.
Construct a PATCH request which interprets the body as a Blob
and returns it.
patch(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<Blob>
: an Observable
of the body as a Blob
.
Construct a PATCH request which interprets the body as text and returns it.
patch(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<string>
: an Observable
of the body as a string
.
Construct a PATCH request which interprets the body as an ArrayBuffer
and returns the full event stream.
patch(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<HttpEvent<ArrayBuffer>>
: an Observable
of all HttpEvent
s for the request, with a body type of ArrayBuffer
.
Construct a PATCH request which interprets the body as a Blob
and returns the full event stream.
patch(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<HttpEvent<Blob>>
: an Observable
of all HttpEvent
s for the request, with a body type of Blob
.
Construct a PATCH request which interprets the body as text and returns the full event stream.
patch(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<HttpEvent<string>>
: an Observable
of all HttpEvent
s for the request, with a body type of string
.
Construct a PATCH request which interprets the body as JSON and returns the full event stream.
patch(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<HttpEvent<Object>>
: an Observable
of all HttpEvent
s for the request, with a body type of Object
.
Construct a PATCH request which interprets the body as JSON and returns the full event stream.
patch<T>(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<HttpEvent<T>>
: an Observable
of all HttpEvent
s for the request, with a body type of T
.
Construct a PATCH request which interprets the body as an ArrayBuffer
and returns the full response.
patch(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<HttpResponse<ArrayBuffer>>
: an Observable
of the HttpResponse
for the request, with a body type of ArrayBuffer
.
Construct a PATCH request which interprets the body as a Blob
and returns the full response.
patch(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<HttpResponse<Blob>>
: an Observable
of the HttpResponse
for the request, with a body type of Blob
.
Construct a PATCH request which interprets the body as text and returns the full response.
patch(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<HttpResponse<string>>
: an Observable
of the HttpResponse
for the request, with a body type of string
.
Construct a PATCH request which interprets the body as JSON and returns the full response.
patch(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<HttpResponse<Object>>
: an Observable
of the HttpResponse
for the request, with a body type of Object
.
Construct a PATCH request which interprets the body as JSON and returns the full response.
patch<T>(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<HttpResponse<T>>
: an Observable
of the HttpResponse
for the request, with a body type of T
.
Construct a PATCH request which interprets the body as JSON and returns it.
patch(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: Optional. Default is |
Returns
Observable<Object>
: an Observable
of the body as an Object
.
Construct a PATCH request which interprets the body as JSON and returns it.
patch<T>(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: Optional. Default is |
Returns
Observable<T>
: an Observable
of the body as type T
.
post() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
url | Type: |
body | Type: |
options | Type: |
Returns
Observable<ArrayBuffer>
: an Observable
of the body as an ArrayBuffer
.
Construct a POST request which interprets the body as a Blob
and returns it.
post(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<Blob>
: an Observable
of the body as a Blob
.
Construct a POST request which interprets the body as text and returns it.
post(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<string>
: an Observable
of the body as a string
.
Construct a POST request which interprets the body as an ArrayBuffer
and returns the full event stream.
post(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<HttpEvent<ArrayBuffer>>
: an Observable
of all HttpEvent
s for the request, with a body type of ArrayBuffer
.
Construct a POST request which interprets the body as a Blob
and returns the full event stream.
post(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<HttpEvent<Blob>>
: an Observable
of all HttpEvent
s for the request, with a body type of Blob
.
Construct a POST request which interprets the body as text and returns the full event stream.
post(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<HttpEvent<string>>
: an Observable
of all HttpEvent
s for the request, with a body type of string
.
Construct a POST request which interprets the body as JSON and returns the full event stream.
post(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<HttpEvent<Object>>
: an Observable
of all HttpEvent
s for the request, with a body type of Object
.
Construct a POST request which interprets the body as JSON and returns the full event stream.
post<T>(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<HttpEvent<T>>
: an Observable
of all HttpEvent
s for the request, with a body type of T
.
Construct a POST request which interprets the body as an ArrayBuffer
and returns the full response.
post(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<HttpResponse<ArrayBuffer>>
: an Observable
of the HttpResponse
for the request, with a body type of ArrayBuffer
.
Construct a POST request which interprets the body as a Blob
and returns the full response.
post(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<HttpResponse<Blob>>
: an Observable
of the HttpResponse
for the request, with a body type of Blob
.
Construct a POST request which interprets the body as text and returns the full response.
post(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<HttpResponse<string>>
: an Observable
of the HttpResponse
for the request, with a body type of string
.
Construct a POST request which interprets the body as JSON and returns the full response.
post(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<HttpResponse<Object>>
: an Observable
of the HttpResponse
for the request, with a body type of Object
.
Construct a POST request which interprets the body as JSON and returns the full response.
post<T>(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<HttpResponse<T>>
: an Observable
of the HttpResponse
for the request, with a body type of T
.
Construct a POST request which interprets the body as JSON and returns it.
post(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: Optional. Default is |
Returns
Observable<Object>
: an Observable
of the body as an Object
.
Construct a POST request which interprets the body as JSON and returns it.
post<T>(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: Optional. Default is |
Returns
Observable<T>
: an Observable
of the body as type T
.
put() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
url | Type: |
body | Type: |
options | Type: |
Returns
Observable<ArrayBuffer>
: an Observable
of the body as an ArrayBuffer
.
Construct a PUT request which interprets the body as a Blob
and returns it.
put(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<Blob>
: an Observable
of the body as a Blob
.
Construct a PUT request which interprets the body as text and returns it.
put(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<string>
: an Observable
of the body as a string
.
Construct a PUT request which interprets the body as an ArrayBuffer
and returns the full event stream.
put(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<HttpEvent<ArrayBuffer>>
: an Observable
of all HttpEvent
s for the request, with a body type of ArrayBuffer
.
Construct a PUT request which interprets the body as a Blob
and returns the full event stream.
put(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<HttpEvent<Blob>>
: an Observable
of all HttpEvent
s for the request, with a body type of Blob
.
Construct a PUT request which interprets the body as text and returns the full event stream.
put(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<HttpEvent<string>>
: an Observable
of all HttpEvent
s for the request, with a body type of string
.
Construct a PUT request which interprets the body as JSON and returns the full event stream.
put(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<HttpEvent<Object>>
: an Observable
of all HttpEvent
s for the request, with a body type of Object
.
Construct a PUT request which interprets the body as JSON and returns the full event stream.
put<T>(url: string, body: any | null, options: {
headers?: HttpHeaders | {
[header: string]: string | string[];
};
observe: 'events';
responseType?: 'json';
withCredentials?: boolean;
}): Observable<HttpEvent<T>>
Parameters
url | Type: |
body | Type: |
options | Type: |
Returns
Observable<HttpEvent<T>>
: an Observable
of all HttpEvent
s for the request, with a body type of T
.
Construct a PUT request which interprets the body as an ArrayBuffer
and returns the full response.
put(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<HttpResponse<ArrayBuffer>>
: an Observable
of the HttpResponse
for the request, with a body type of ArrayBuffer
.
Construct a PUT request which interprets the body as a Blob
and returns the full response.
put(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<HttpResponse<Blob>>
: an Observable
of the HttpResponse
for the request, with a body type of Blob
.
Construct a PUT request which interprets the body as text and returns the full response.
put(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<HttpResponse<string>>
: an Observable
of the HttpResponse
for the request, with a body type of string
.
Construct a PUT request which interprets the body as JSON and returns the full response.
put(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<HttpResponse<Object>>
: an Observable
of the HttpResponse
for the request, with a body type of Object
.
Construct a PUT request which interprets the body as JSON and returns the full response.
put<T>(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: |
Returns
Observable<HttpResponse<T>>
: an Observable
of the HttpResponse
for the request, with a body type of T
.
Construct a PUT request which interprets the body as JSON and returns it.
put(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: Optional. Default is |
Returns
Observable<Object>
: an Observable
of the body as an Object
.
Construct a PUT request which interprets the body as JSON and returns it.
put<T>(url: string, body: any | null, 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 | Type: |
body | Type: |
options | Type: Optional. Default is |
Returns
Observable<T>
: an Observable
of the body as type T
.
© 2010–2019 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v6.angular.io/api/common/http/HttpClient