HttpClient

class

npm Package @angular/common
Module import { HttpClient } from '@angular/common/http';
Source common/http/src/client.ts

Overview

class HttpClient {
  constructor(handler: HttpHandler)
  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

Perform HTTP requests.

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).

Constructor

constructor(handler: HttpHandler)

Members

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' | 'blob' | 'json' | 'text'; withCredentials?: boolean; } = {}): Observable<any>

Constructs an Observable for a particular HTTP request that, when subscribed, fires the request through the chain of registered interceptors and on to the server.

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.

Overloads

request<R>(req: HttpRequest<any>): Observable<HttpEvent<R>>

Send the given HttpRequest and return a stream of HttpEvents.

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>

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: 'blob'; withCredentials?: boolean; }): Observable<Blob>

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: 'text'; withCredentials?: boolean; }): Observable<string>

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[]; }; params?: HttpParams | { [param: string]: string | string[]; }; observe: 'events'; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable<HttpEvent<ArrayBuffer>>

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[]; }; observe: 'events'; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: 'blob'; withCredentials?: boolean; }): Observable<HttpEvent<Blob>>

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: 'text'; withCredentials?: boolean; }): Observable<HttpEvent<string>>

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[]; }; reportProgress?: boolean; observe: 'events'; params?: HttpParams | { [param: string]: string | string[]; }; responseType?: 'json'; withCredentials?: boolean; }): Observable<HttpEvent<any>>

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>>

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[]; }; observe: 'response'; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable<HttpResponse<ArrayBuffer>>

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: 'blob'; withCredentials?: boolean; }): Observable<HttpResponse<Blob>>

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: 'text'; withCredentials?: boolean; }): Observable<HttpResponse<string>>

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[]; }; reportProgress?: boolean; observe: 'response'; params?: HttpParams | { [param: string]: string | string[]; }; responseType?: 'json'; withCredentials?: boolean; }): Observable<HttpResponse<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>>

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[]; }; observe?: 'body'; params?: HttpParams | { [param: string]: string | string[]; }; responseType?: 'json'; reportProgress?: boolean; withCredentials?: boolean; }): Observable<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>

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[]; }; params?: HttpParams | { [param: string]: string | string[]; }; observe?: HttpObserve; reportProgress?: boolean; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; }): Observable<any>

Construct a request in a manner where response type and requested Observable are not known statically.

delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: HttpObserve; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; } = {}): Observable<any>

Constructs an Observable which, when subscribed, will cause the configured DELETE request to be executed on the server. See the individual overloads for details of delete()'s return type based on the provided options.

Overloads

delete(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: 'body'; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable<ArrayBuffer>

Construct a DELETE request which interprets the body as an ArrayBuffer 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>

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: 'text'; withCredentials?: boolean; }): Observable<string>

Construct a DELETE request which interprets the body as text and returns it.

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>>

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: 'blob'; withCredentials?: boolean; }): Observable<HttpEvent<Blob>>

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: 'text'; withCredentials?: boolean; }): Observable<HttpEvent<string>>

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?: 'json'; withCredentials?: boolean; }): Observable<HttpEvent<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>>

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: 'response'; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable<HttpResponse<ArrayBuffer>>

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: 'blob'; withCredentials?: boolean; }): Observable<HttpResponse<Blob>>

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: 'text'; withCredentials?: boolean; }): Observable<HttpResponse<string>>

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?: 'json'; withCredentials?: boolean; }): Observable<HttpResponse<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>>

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?: 'body'; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable<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>

Construct a DELETE request which interprets the body as JSON and returns it.

get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: HttpObserve; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; } = {}): Observable<any>

Constructs an Observable which, when subscribed, will cause the configured GET request to be executed on the server. See the individual overloads for details of get()'s return type based on the provided options.

Overloads

get(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: 'body'; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable<ArrayBuffer>

Construct a GET request which interprets the body as an ArrayBuffer 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>

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: 'text'; withCredentials?: boolean; }): Observable<string>

Construct a GET request which interprets the body as text and returns it.

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>>

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: 'blob'; withCredentials?: boolean; }): Observable<HttpEvent<Blob>>

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: 'text'; withCredentials?: boolean; }): Observable<HttpEvent<string>>

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?: 'json'; withCredentials?: boolean; }): Observable<HttpEvent<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>>

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: 'response'; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable<HttpResponse<ArrayBuffer>>

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: 'blob'; withCredentials?: boolean; }): Observable<HttpResponse<Blob>>

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: 'text'; withCredentials?: boolean; }): Observable<HttpResponse<string>>

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?: 'json'; withCredentials?: boolean; }): Observable<HttpResponse<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>>

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?: 'body'; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable<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>

Construct a GET request which interprets the body as JSON and returns it.

head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: HttpObserve; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; } = {}): Observable<any>

Constructs an Observable which, when subscribed, will cause the configured HEAD request to be executed on the server. See the individual overloads for details of head()'s return type based on the provided options.

Overloads

head(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: 'body'; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable<ArrayBuffer>

Construct a HEAD request which interprets the body as an ArrayBuffer and returns it.

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>

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>

Construct a HEAD request which interprets the body as text and returns it.

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>>

Construct a GET 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: 'blob'; withCredentials?: boolean; }): Observable<HttpEvent<Blob>>

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: 'text'; withCredentials?: boolean; }): Observable<HttpEvent<string>>

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?: 'json'; withCredentials?: boolean; }): Observable<HttpEvent<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>>

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: 'response'; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable<HttpResponse<ArrayBuffer>>

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: 'blob'; withCredentials?: boolean; }): Observable<HttpResponse<Blob>>

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: 'text'; withCredentials?: boolean; }): Observable<HttpResponse<string>>

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?: 'json'; withCredentials?: boolean; }): Observable<HttpResponse<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>>

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?: 'body'; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable<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>

Construct a HEAD request which interprets the body as JSON and returns it.

jsonp<T>(url: string, callbackParam: string): Observable<T>

Constructs an Observable which, when subscribed, will cause a request with the special method JSONP to be dispatched via the interceptor pipeline.

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.

Overloads

jsonp(url: string, callbackParam: string): Observable<Object>

Construct a JSONP request for the given URL and name of the callback parameter.

jsonp<T>(url: string, callbackParam: string): Observable<T>

Construct a JSONP request for the given URL and name of the callback parameter.

options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: HttpObserve; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; } = {}): Observable<any>

Constructs an Observable which, when subscribed, will cause the configured OPTIONS request to be executed on the server. See the individual overloads for details of options()'s return type based on the provided options.

Overloads

options(url: string, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: 'body'; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable<ArrayBuffer>

Make an OPTIONS request which interprets the body as an ArrayBuffer 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>

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: 'text'; withCredentials?: boolean; }): Observable<string>

Construct a OPTIONS request which interprets the body as text and returns it.

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>>

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: 'blob'; withCredentials?: boolean; }): Observable<HttpEvent<Blob>>

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: 'text'; withCredentials?: boolean; }): Observable<HttpEvent<string>>

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?: 'json'; withCredentials?: boolean; }): Observable<HttpEvent<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>>

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: 'response'; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable<HttpResponse<ArrayBuffer>>

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: 'blob'; withCredentials?: boolean; }): Observable<HttpResponse<Blob>>

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: 'text'; withCredentials?: boolean; }): Observable<HttpResponse<string>>

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?: 'json'; withCredentials?: boolean; }): Observable<HttpResponse<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>>

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?: 'body'; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable<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>

Construct an OPTIONS request which interprets the body as JSON and returns it.

patch(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: HttpObserve; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; } = {}): Observable<any>

Constructs an Observable which, when subscribed, will cause the configured PATCH request to be executed on the server. See the individual overloads for details of patch()'s return type based on the provided options.

Overloads

patch(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: 'body'; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable<ArrayBuffer>

Construct a PATCH request which interprets the body as an ArrayBuffer 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>

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: 'text'; withCredentials?: boolean; }): Observable<string>

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: 'events'; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable<HttpEvent<ArrayBuffer>>

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: 'blob'; withCredentials?: boolean; }): Observable<HttpEvent<Blob>>

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: 'text'; withCredentials?: boolean; }): Observable<HttpEvent<string>>

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?: 'json'; withCredentials?: boolean; }): Observable<HttpEvent<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>>

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: 'response'; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable<HttpResponse<ArrayBuffer>>

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: 'blob'; withCredentials?: boolean; }): Observable<HttpResponse<Blob>>

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: 'text'; withCredentials?: boolean; }): Observable<HttpResponse<string>>

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?: 'json'; withCredentials?: boolean; }): Observable<HttpResponse<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>>

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?: 'body'; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable<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>

Construct a PATCH request which interprets the body as JSON and returns it.

post(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: HttpObserve; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; } = {}): Observable<any>

Constructs an Observable which, when subscribed, will cause the configured POST request to be executed on the server. See the individual overloads for details of post()'s return type based on the provided options.

Overloads

post(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: 'body'; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable<ArrayBuffer>

Construct a POST request which interprets the body as an ArrayBuffer 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>

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: 'text'; withCredentials?: boolean; }): Observable<string>

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: 'events'; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable<HttpEvent<ArrayBuffer>>

Construct a PATCH 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: 'blob'; withCredentials?: boolean; }): Observable<HttpEvent<Blob>>

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: 'text'; withCredentials?: boolean; }): Observable<HttpEvent<string>>

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?: 'json'; withCredentials?: boolean; }): Observable<HttpEvent<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>>

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: 'response'; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable<HttpResponse<ArrayBuffer>>

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: 'blob'; withCredentials?: boolean; }): Observable<HttpResponse<Blob>>

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: 'text'; withCredentials?: boolean; }): Observable<HttpResponse<string>>

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?: 'json'; withCredentials?: boolean; }): Observable<HttpResponse<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>>

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?: 'body'; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable<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>

Construct a POST request which interprets the body as JSON and returns it.

put(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: HttpObserve; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: 'arraybuffer' | 'blob' | 'json' | 'text'; withCredentials?: boolean; } = {}): Observable<any>

Constructs an Observable which, when subscribed, will cause the configured POST request to be executed on the server. See the individual overloads for details of post()'s return type based on the provided options.

Overloads

put(url: string, body: any | null, options: { headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: 'body'; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable<ArrayBuffer>

Construct a PUT request which interprets the body as an ArrayBuffer 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>

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: 'text'; withCredentials?: boolean; }): Observable<string>

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: 'events'; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable<HttpEvent<ArrayBuffer>>

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: 'blob'; withCredentials?: boolean; }): Observable<HttpEvent<Blob>>

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: 'text'; withCredentials?: boolean; }): Observable<HttpEvent<string>>

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?: 'json'; withCredentials?: boolean; }): Observable<HttpEvent<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>>

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: 'response'; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType: 'arraybuffer'; withCredentials?: boolean; }): Observable<HttpResponse<ArrayBuffer>>

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: 'blob'; withCredentials?: boolean; }): Observable<HttpResponse<Blob>>

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: 'text'; withCredentials?: boolean; }): Observable<HttpResponse<string>>

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?: 'json'; withCredentials?: boolean; }): Observable<HttpResponse<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>>

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?: 'body'; params?: HttpParams | { [param: string]: string | string[]; }; reportProgress?: boolean; responseType?: 'json'; withCredentials?: boolean; }): Observable<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>

Construct a PUT request which interprets the body as JSON and returns it.

Annotations

@Injectable()

© 2010–2018 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v5.angular.io/api/common/http/HttpClient