[ Web Proxy ]
URL:
Viewing: https://angular.dev/api/common/http/HttpClient [Back]  [Original]

HttpClient Angular Skip to main content
menu
close
more_horiz
menuAPI
@angular/common/http

HttpClient

Class
stable

Performs HTTP requests. This service is available as an injectable class, with methods to perform HTTP requests. Each request method has multiple signatures, and the return type varies based on the signature that is called (mainly the values of observe and responseType).

HTTP GuideHTTP Request

On this page

    arrow_upward_alt Back to the top

    API

        
          class HttpClient {  constructor(handler: HttpHandler): HttpClient;
    request<R>(req: HttpRequest<any>): Observable<HttpEvent<R>>; request(method: string, url: string, options: { body?: any; observe?: "body" | undefined; responseType: "arraybuffer"; } & HttpClientCommonOptions): Observable<ArrayBuffer>; request(method: string, url: string, options: { body?: any; observe?: "body" | undefined; responseType: "blob"; } & HttpClientCommonOptions): Observable<Blob>; request(method: string, url: string, options: { body?: any; observe?: "body" | undefined; responseType: "text"; } & HttpClientCommonOptions): Observable<string>; request(method: string, url: string, options: { body?: any; observe: "events"; responseType: "arraybuffer"; } & HttpClientCommonOptions): Observable<HttpEvent<ArrayBuffer>>; request(method: string, url: string, options: { body?: any; observe: "events"; responseType: "blob"; } & HttpClientCommonOptions): Observable<HttpEvent<Blob>>; request(method: string, url: string, options: { body?: any; observe: "events"; responseType: "text"; } & HttpClientCommonOptions): Observable<HttpEvent<string>>; request(method: string, url: string, options: { body?: any; observe: "events"; responseType?: "json" | undefined; } & HttpClientCommonOptions): Observable<HttpEvent<any>>; request<R>(method: string, url: string, options: { body?: any; observe: "events"; responseType?: "json" | undefined; } & HttpClientCommonOptions): Observable<HttpEvent<R>>; request(method: string, url: string, options: { body?: any; observe: "response"; responseType: "arraybuffer"; } & HttpClientCommonOptions): Observable<HttpResponse<ArrayBuffer>>; request(method: string, url: string, options: { body?: any; observe: "response"; responseType: "blob"; } & HttpClientCommonOptions): Observable<HttpResponse<Blob>>; request(method: string, url: string, options: { body?: any; observe: "response"; responseType: "text"; } & HttpClientCommonOptions): Observable<HttpResponse<string>>; request(method: string, url: string, options: { body?: any; observe: "response"; responseType?: "json" | undefined; } & HttpClientCommonOptions): Observable<HttpResponse<Object>>; request<R>(method: string, url: string, options: { body?: any; observe: "response"; responseType?: "json" | undefined; } & HttpClientCommonOptions): Observable<HttpResponse<R>>; request(method: string, url: string, options?: ({ body?: any; observe?: "body" | undefined; responseType?: "json" | undefined; } & HttpClientCommonOptions) | undefined): Observable<Object>; request<R>(method: string, url: string, options?: ({ body?: any; observe?: "body" | undefined; responseType?: "json" | undefined; } & HttpClientCommonOptions) | undefined): Observable<R>; request(method: string, url: string, options?: ({ body?: any; observe?: "body" | "events" | "response" | undefined; responseType?: "arraybuffer" | "blob" | "json" | "text" | undefined; } & HttpClientCommonOptions) | undefined): Observable<any>;
    delete(url: string, options: { observe?: "body" | undefined; responseType: "arraybuffer"; body?: any; } & HttpClientCommonOptions): Observable<ArrayBuffer>; delete(url: string, options: { observe?: "body" | undefined; responseType: "blob"; body?: any; } & HttpClientCommonOptions): Observable<Blob>; delete(url: string, options: { observe?: "body" | undefined; responseType: "text"; body?: any; } & HttpClientCommonOptions): Observable<string>; delete(url: string, options: { observe: "events"; responseType: "arraybuffer"; body?: any; } & HttpClientCommonOptions): Observable<HttpEvent<ArrayBuffer>>; delete(url: string, options: { observe: "events"; responseType: "blob"; body?: any; } & HttpClientCommonOptions): Observable<HttpEvent<Blob>>; delete(url: string, options: { observe: "events"; responseType: "text"; body?: any; } & HttpClientCommonOptions): Observable<HttpEvent<string>>; delete(url: string, options: { observe: "events"; responseType?: "json" | undefined; body?: any; } & HttpClientCommonOptions): Observable<HttpEvent<Object>>; delete<T>(url: string, options: { observe: "events"; responseType?: "json" | undefined; body?: any; } & HttpClientCommonOptions): Observable<HttpEvent<T>>; delete(url: string, options: { observe: "response"; responseType: "arraybuffer"; body?: any; } & HttpClientCommonOptions): Observable<HttpResponse<ArrayBuffer>>; delete(url: string, options: { observe: "response"; responseType: "blob"; body?: any; } & HttpClientCommonOptions): Observable<HttpResponse<Blob>>; delete(url: string, options: { observe: "response"; responseType: "text"; body?: any; } & HttpClientCommonOptions): Observable<HttpResponse<string>>; delete(url: string, options: { observe: "response"; responseType?: "json" | undefined; body?: any; } & HttpClientCommonOptions): Observable<HttpResponse<Object>>; delete<T>(url: string, options: { observe: "response"; responseType?: "json" | undefined; body?: any; } & HttpClientCommonOptions): Observable<HttpResponse<T>>; delete(url: string, options?: ({ observe?: "body" | undefined; responseType?: "json" | undefined; body?: any; } & HttpClientCommonOptions) | undefined): Observable<Object>; delete<T>(url: string, options?: ({ observe?: "body" | undefined; responseType?: "json" | undefined; body?: any; } & HttpClientCommonOptions) | undefined): Observable<T>;
    get(url: string, options: { observe?: "body" | undefined; responseType: "arraybuffer"; } & HttpClientCommonOptions): Observable<ArrayBuffer>; get(url: string, options: { observe?: "body" | undefined; responseType: "blob"; } & HttpClientCommonOptions): Observable<Blob>; get(url: string, options: { observe?: "body" | undefined; responseType: "text"; } & HttpClientCommonOptions): Observable<string>; get(url: string, options: { observe: "events"; responseType: "arraybuffer"; } & HttpClientCommonOptions): Observable<HttpEvent<ArrayBuffer>>; get(url: string, options: { observe: "events"; responseType: "blob"; } & HttpClientCommonOptions): Observable<HttpEvent<Blob>>; get(url: string, options: { observe: "events"; responseType: "text"; } & HttpClientCommonOptions): Observable<HttpEvent<string>>; get(url: string, options: { observe: "events"; responseType?: "json" | undefined; } & HttpClientCommonOptions): Observable<HttpEvent<Object>>; get<T>(url: string, options: { observe: "events"; responseType?: "json" | undefined; } & HttpClientCommonOptions): Observable<HttpEvent<T>>; get(url: string, options: { observe: "response"; responseType: "arraybuffer"; } & HttpClientCommonOptions): Observable<HttpResponse<ArrayBuffer>>; get(url: string, options: { observe: "response"; responseType: "blob"; } & HttpClientCommonOptions): Observable<HttpResponse<Blob>>; get(url: string, options: { observe: "response"; responseType: "text"; } & HttpClientCommonOptions): Observable<HttpResponse<string>>; get(url: string, options: { observe: "response"; responseType?: "json" | undefined; } & HttpClientCommonOptions): Observable<HttpResponse<Object>>; get<T>(url: string, options: { observe: "response"; responseType?: "json" | undefined; } & HttpClientCommonOptions): Observable<HttpResponse<T>>; get(url: string, options?: ({ observe?: "body" | undefined; responseType?: "json" | undefined; } & HttpClientCommonOptions) | undefined): Observable<Object>; get<T>(url: string, options?: ({ observe?: "body" | undefined; responseType?: "json" | undefined; } & HttpClientCommonOptions) | undefined): Observable<T>;
    head(url: string, options: { observe?: "body" | undefined; responseType: "arraybuffer"; } & HttpClientCommonOptions): Observable<ArrayBuffer>; head(url: string, options: { observe?: "body" | undefined; responseType: "blob"; } & HttpClientCommonOptions): Observable<Blob>; head(url: string, options: { observe?: "body" | undefined; responseType: "text"; } & HttpClientCommonOptions): Observable<string>; head(url: string, options: { observe: "events"; responseType: "arraybuffer"; } & HttpClientCommonOptions): Observable<HttpEvent<ArrayBuffer>>; head(url: string, options: { observe: "events"; responseType: "blob"; } & HttpClientCommonOptions): Observable<HttpEvent<Blob>>; head(url: string, options: { observe: "events"; responseType: "text"; } & HttpClientCommonOptions): Observable<HttpEvent<string>>; head(url: string, options: { observe: "events"; responseType?: "json" | undefined; } & HttpClientCommonOptions): Observable<HttpEvent<Object>>; head<T>(url: string, options: { observe: "events"; responseType?: "json" | undefined; } & HttpClientCommonOptions): Observable<HttpEvent<T>>; head(url: string, options: { observe: "response"; responseType: "arraybuffer"; } & HttpClientCommonOptions): Observable<HttpResponse<ArrayBuffer>>; head(url: string, options: { observe: "response"; responseType: "blob"; } & HttpClientCommonOptions): Observable<HttpResponse<Blob>>; head(url: string, options: { observe: "response"; responseType: "text"; } & HttpClientCommonOptions): Observable<HttpResponse<string>>; head(url: string, options: { observe: "response"; responseType?: "json" | undefined; } & HttpClientCommonOptions): Observable<HttpResponse<Object>>; head<T>(url: string, options: { observe: "response"; responseType?: "json" | undefined; } & HttpClientCommonOptions): Observable<HttpResponse<T>>; head(url: string, options?: HttpClientCommonOptions | undefined): Observable<Object>; head<T>(url: string, options?: HttpClientCommonOptions | undefined): Observable<T>;
    jsonp(url: string, callbackParam: string): Observable<Object>; jsonp<T>(url: string, callbackParam: string): Observable<T>;
    options(url: string, options: { observe?: "body" | undefined; responseType: "arraybuffer"; } & HttpClientCommonOptions): Observable<ArrayBuffer>; options(url: string, options: { observe?: "body" | undefined; responseType: "blob"; } & HttpClientCommonOptions): Observable<Blob>; options(url: string, options: { observe?: "body" | undefined; responseType: "text"; } & HttpClientCommonOptions): Observable<string>; options(url: string, options: { observe: "events"; responseType: "arraybuffer"; } & HttpClientCommonOptions): Observable<HttpEvent<ArrayBuffer>>; options(url: string, options: { observe: "events"; responseType: "blob"; } & HttpClientCommonOptions): Observable<HttpEvent<Blob>>; options(url: string, options: { observe: "events"; responseType: "text"; } & HttpClientCommonOptions): Observable<HttpEvent<string>>; options(url: string, options: { observe: "events"; responseType?: "json" | undefined; } & HttpClientCommonOptions): Observable<HttpEvent<Object>>; options<T>(url: string, options: { observe: "events"; responseType?: "json" | undefined; } & HttpClientCommonOptions): Observable<HttpEvent<T>>; options(url: string, options: { observe: "response"; responseType: "arraybuffer"; } & HttpClientCommonOptions): Observable<HttpResponse<ArrayBuffer>>; options(url: string, options: { observe: "response"; responseType: "blob"; } & HttpClientCommonOptions): Observable<HttpResponse<Blob>>; options(url: string, options: { observe: "response"; responseType: "text"; } & HttpClientCommonOptions): Observable<HttpResponse<string>>; options(url: string, options: { observe: "response"; responseType?: "json" | undefined; } & HttpClientCommonOptions): Observable<HttpResponse<Object>>; options<T>(url: string, options: { observe: "response"; responseType?: "json" | undefined; } & HttpClientCommonOptions): Observable<HttpResponse<T>>; options(url: string, options?: HttpClientCommonOptions | undefined): Observable<Object>; options<T>(url: string, options?: HttpClientCommonOptions | undefined): Observable<T>;
    patch(url: string, body: any, options: { observe?: "body" | undefined; responseType: "arraybuffer"; } & HttpClientCommonOptions): Observable<ArrayBuffer>; patch(url: string, body: any, options: { observe?: "body" | undefined; responseType: "blob"; } & HttpClientCommonOptions): Observable<Blob>; patch(url: string, body: any, options: { observe?: "body" | undefined; responseType: "text"; } & HttpClientCommonOptions): Observable<string>; patch(url: string, body: any, options: { observe: "events"; responseType: "arraybuffer"; } & HttpClientCommonOptions): Observable<HttpEvent<ArrayBuffer>>; patch(url: string, body: any, options: { observe: "events"; responseType: "blob"; } & HttpClientCommonOptions): Observable<HttpEvent<Blob>>; patch(url: string, body: any, options: { observe: "events"; responseType: "text"; } & HttpClientCommonOptions): Observable<HttpEvent<string>>; patch(url: string, body: any, options: { observe: "events"; responseType?: "json" | undefined; } & HttpClientCommonOptions): Observable<HttpEvent<Object>>; patch<T>(url: string, body: any, options: { observe: "events"; responseType?: "json" | undefined; } & HttpClientCommonOptions): Observable<HttpEvent<T>>; patch(url: string, body: any, options: { observe: "response"; responseType: "arraybuffer"; } & HttpClientCommonOptions): Observable<HttpResponse<ArrayBuffer>>; patch(url: string, body: any, options: { observe: "response"; responseType: "blob"; } & HttpClientCommonOptions): Observable<HttpResponse<Blob>>; patch(url: string, body: any, options: { observe: "response"; responseType: "text"; } & HttpClientCommonOptions): Observable<HttpResponse<string>>; patch(url: string, body: any, options: { observe: "response"; responseType?: "json" | undefined; } & HttpClientCommonOptions): Observable<HttpResponse<Object>>; patch<T>(url: string, body: any, options: { observe: "response"; responseType?: "json" | undefined; } & HttpClientCommonOptions): Observable<HttpResponse<T>>; patch(url: string, body: any, options?: HttpClientCommonOptions | undefined): Observable<Object>; patch<T>(url: string, body: any, options?: HttpClientCommonOptions | undefined): Observable<T>;
    post(url: string, body: any, options: { observe?: "body" | undefined; responseType: "arraybuffer"; } & HttpClientCommonOptions): Observable<ArrayBuffer>; post(url: string, body: any, options: { observe?: "body" | undefined; responseType: "blob"; } & HttpClientCommonOptions): Observable<Blob>; post(url: string, body: any, options: { observe?: "body" | undefined; responseType: "text"; } & HttpClientCommonOptions): Observable<string>; post(url: string, body: any, options: { observe: "events"; responseType: "arraybuffer"; } & HttpClientCommonOptions): Observable<HttpEvent<ArrayBuffer>>; post(url: string, body: any, options: { observe: "events"; responseType: "blob"; } & HttpClientCommonOptions): Observable<HttpEvent<Blob>>; post(url: string, body: any, options: { observe: "events"; responseType: "text"; } & HttpClientCommonOptions): Observable<HttpEvent<string>>; post(url: string, body: any, options: { observe: "events"; responseType?: "json" | undefined; } & HttpClientCommonOptions): Observable<HttpEvent<Object>>; post<T>(url: string, body: any, options: { observe: "events"; responseType?: "json" | undefined; } & HttpClientCommonOptions): Observable<HttpEvent<T>>; post(url: string, body: any, options: { observe: "response"; responseType: "arraybuffer"; } & HttpClientCommonOptions): Observable<HttpResponse<ArrayBuffer>>; post(url: string, body: any, options: { observe: "response"; responseType: "blob"; } & HttpClientCommonOptions): Observable<HttpResponse<Blob>>; post(url: string, body: any, options: { observe: "response"; responseType: "text"; } & HttpClientCommonOptions): Observable<HttpResponse<string>>; post(url: string, body: any, options: { observe: "response"; responseType?: "json" | undefined; } & HttpClientCommonOptions): Observable<HttpResponse<Object>>; post<T>(url: string, body: any, options: { observe: "response"; responseType?: "json" | undefined; } & HttpClientCommonOptions): Observable<HttpResponse<T>>; post(url: string, body: any, options?: HttpClientCommonOptions | undefined): Observable<Object>; post<T>(url: string, body: any, options?: HttpClientCommonOptions | undefined): Observable<T>;
    put(url: string, body: any, options: { observe?: "body" | undefined; responseType: "arraybuffer"; } & HttpClientCommonOptions): Observable<ArrayBuffer>; put(url: string, body: any, options: { observe?: "body" | undefined; responseType: "blob"; } & HttpClientCommonOptions): Observable<Blob>; put(url: string, body: any, options: { observe?: "body" | undefined; responseType: "text"; } & HttpClientCommonOptions): Observable<string>; put(url: string, body: any, options: { observe: "events"; responseType: "arraybuffer"; } & HttpClientCommonOptions): Observable<HttpEvent<ArrayBuffer>>; put(url: string, body: any, options: { observe: "events"; responseType: "blob"; } & HttpClientCommonOptions): Observable<HttpEvent<Blob>>; put(url: string, body: any, options: { observe: "events"; responseType: "text"; } & HttpClientCommonOptions): Observable<HttpEvent<string>>; put(url: string, body: any, options: { observe: "events"; responseType?: "json" | undefined; } & HttpClientCommonOptions): Observable<HttpEvent<Object>>; put<T>(url: string, body: any, options: { observe: "events"; responseType?: "json" | undefined; } & HttpClientCommonOptions): Observable<HttpEvent<T>>; put(url: string, body: any, options: { observe: "response"; responseType: "arraybuffer"; } & HttpClientCommonOptions): Observable<HttpResponse<ArrayBuffer>>; put(url: string, body: any, options: { observe: "response"; responseType: "blob"; } & HttpClientCommonOptions): Observable<HttpResponse<Blob>>; put(url: string, body: any, options: { observe: "response"; responseType: "text"; } & HttpClientCommonOptions): Observable<HttpResponse<string>>; put(url: string, body: any, options: { observe: "response"; responseType?: "json" | undefined; } & HttpClientCommonOptions): Observable<HttpResponse<Object>>; put<T>(url: string, body: any, options: { observe: "response"; responseType?: "json" | undefined; } & HttpClientCommonOptions): Observable<HttpResponse<T>>; put(url: string, body: any, options?: HttpClientCommonOptions | undefined): Observable<Object>; put<T>(url: string, body: any, options?: HttpClientCommonOptions | undefined): Observable<T>;
    }

    request

    17 overloads

    Sends an HttpRequest and returns a stream of HttpEvents.

    @paramreqHttpRequest<any>
    @returnsObservable<HttpEvent<R>>

    Constructs a request that interprets the body as an ArrayBuffer and returns the response in an ArrayBuffer.

    @parammethodstring

    The HTTP method.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ body?: any; observe?: "body" | undefined; responseType: "arraybuffer"; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<ArrayBuffer>

    Constructs a request that interprets the body as a blob and returns the response as a blob.

    @parammethodstring

    The HTTP method.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ body?: any; observe?: "body" | undefined; responseType: "blob"; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<Blob>

    Constructs a request that interprets the body as a text string and returns a string value.

    @parammethodstring

    The HTTP method.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ body?: any; observe?: "body" | undefined; responseType: "text"; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<string>

    Constructs a request that interprets the body as an ArrayBuffer and returns the the full event stream.

    @parammethodstring

    The HTTP method.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ body?: any; observe: "events"; responseType: "arraybuffer"; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<HttpEvent<ArrayBuffer>>

    Constructs a request that interprets the body as a Blob and returns the full event stream.

    @parammethodstring

    The HTTP method.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ body?: any; observe: "events"; responseType: "blob"; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<HttpEvent<Blob>>

    Constructs a request which interprets the body as a text string and returns the full event stream.

    @parammethodstring

    The HTTP method.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ body?: any; observe: "events"; responseType: "text"; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<HttpEvent<string>>

    Constructs a request which interprets the body as a JavaScript object and returns the full event stream.

    @parammethodstring

    The HTTP method.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ body?: any; observe: "events"; responseType?: "json" | undefined; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<HttpEvent<any>>

    Constructs a request which interprets the body as a JavaScript object and returns the full event stream.

    @parammethodstring

    The HTTP method.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ body?: any; observe: "events"; responseType?: "json" | undefined; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<HttpEvent<R>>

    Constructs a request which interprets the body as an ArrayBuffer and returns the full HttpResponse.

    @parammethodstring

    The HTTP method.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ body?: any; observe: "response"; responseType: "arraybuffer"; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<HttpResponse<ArrayBuffer>>

    Constructs a request which interprets the body as a Blob and returns the full HttpResponse.

    @parammethodstring

    The HTTP method.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ body?: any; observe: "response"; responseType: "blob"; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<HttpResponse<Blob>>

    Constructs a request which interprets the body as a text stream and returns the full HttpResponse.

    @parammethodstring

    The HTTP method.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ body?: any; observe: "response"; responseType: "text"; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<HttpResponse<string>>

    Constructs a request which interprets the body as a JavaScript object and returns the full HttpResponse.

    @parammethodstring

    The HTTP method.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ body?: any; observe: "response"; responseType?: "json" | undefined; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<HttpResponse<Object>>

    Constructs a request which interprets the body as a JavaScript object and returns the full HttpResponse with the response body in the requested type.

    @parammethodstring

    The HTTP method.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ body?: any; observe: "response"; responseType?: "json" | undefined; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<HttpResponse<R>>

    Constructs a request which interprets the body as a JavaScript object and returns the full HttpResponse as a JavaScript object.

    @parammethodstring

    The HTTP method.

    @paramurlstring

    The endpoint URL.

    @paramoptions({ body?: any; observe?: "body" | undefined; responseType?: "json" | undefined; } & HttpClientCommonOptions) | undefined

    The HTTP options to send with the request.

    @returnsObservable<Object>

    Constructs a request which interprets the body as a JavaScript object with the response body of the requested type.

    @parammethodstring

    The HTTP method.

    @paramurlstring

    The endpoint URL.

    @paramoptions({ body?: any; observe?: "body" | undefined; responseType?: "json" | undefined; } & HttpClientCommonOptions) | undefined

    The HTTP options to send with the request.

    @returnsObservable<R>

    Constructs a request where response type and requested observable are not known statically.

    @parammethodstring

    The HTTP method.

    @paramurlstring

    The endpoint URL.

    @paramoptions({ body?: any; observe?: "body" | "events" | "response" | undefined; responseType?: "arraybuffer" | "blob" | "json" | "text" | undefined; } & HttpClientCommonOptions) | undefined

    The HTTP options to send with the request.

    @returnsObservable<any>

    delete

    15 overloads

    Constructs a DELETE request that interprets the body as an ArrayBuffer and returns the response as an ArrayBuffer.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe?: "body" | undefined; responseType: "arraybuffer"; body?: any; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<ArrayBuffer>

    Constructs a DELETE request that interprets the body as a Blob and returns the response as a Blob.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe?: "body" | undefined; responseType: "blob"; body?: any; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<Blob>

    Constructs a DELETE request that interprets the body as a text string and returns a string.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe?: "body" | undefined; responseType: "text"; body?: any; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<string>

    Constructs a DELETE request that interprets the body as an ArrayBuffer and returns the full event stream.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe: "events"; responseType: "arraybuffer"; body?: any; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<HttpEvent<ArrayBuffer>>

    Constructs a DELETE request that interprets the body as a Blob and returns the full event stream.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe: "events"; responseType: "blob"; body?: any; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<HttpEvent<Blob>>

    Constructs a DELETE request that interprets the body as a text string and returns the full event stream.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe: "events"; responseType: "text"; body?: any; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<HttpEvent<string>>

    Constructs a DELETE request that interprets the body as JSON and returns the full event stream.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe: "events"; responseType?: "json" | undefined; body?: any; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<HttpEvent<Object>>

    Constructs a DELETErequest that interprets the body as JSON and returns the full event stream.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe: "events"; responseType?: "json" | undefined; body?: any; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<HttpEvent<T>>

    Constructs a DELETE request that interprets the body as an ArrayBuffer and returns the full HttpResponse.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe: "response"; responseType: "arraybuffer"; body?: any; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<HttpResponse<ArrayBuffer>>

    Constructs a DELETE request that interprets the body as a Blob and returns the full HttpResponse.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe: "response"; responseType: "blob"; body?: any; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<HttpResponse<Blob>>

    Constructs a DELETE request that interprets the body as a text stream and returns the full HttpResponse.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe: "response"; responseType: "text"; body?: any; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<HttpResponse<string>>

    Constructs a DELETE request the interprets the body as a JavaScript object and returns the full HttpResponse.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe: "response"; responseType?: "json" | undefined; body?: any; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<HttpResponse<Object>>

    Constructs a DELETE request that interprets the body as JSON and returns the full HttpResponse.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe: "response"; responseType?: "json" | undefined; body?: any; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<HttpResponse<T>>

    Constructs a DELETE request that interprets the body as JSON and returns the response body as an object parsed from JSON.

    @paramurlstring

    The endpoint URL.

    @paramoptions({ observe?: "body" | undefined; responseType?: "json" | undefined; body?: any; } & HttpClientCommonOptions) | undefined

    The HTTP options to send with the request.

    @returnsObservable<Object>

    Constructs a DELETE request that interprets the body as JSON and returns the response in a given type.

    @paramurlstring

    The endpoint URL.

    @paramoptions({ observe?: "body" | undefined; responseType?: "json" | undefined; body?: any; } & HttpClientCommonOptions) | undefined

    The HTTP options to send with the request.

    @returnsObservable<T>

    get

    15 overloads

    Constructs a GET request that interprets the body as an ArrayBuffer and returns the response in an ArrayBuffer.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe?: "body" | undefined; responseType: "arraybuffer"; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<ArrayBuffer>

    Constructs a GET request that interprets the body as a Blob and returns the response as a Blob.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe?: "body" | undefined; responseType: "blob"; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<Blob>

    Constructs a GET request that interprets the body as a text string and returns the response as a string value.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe?: "body" | undefined; responseType: "text"; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<string>

    Constructs a GET request that interprets the body as an ArrayBuffer and returns the full event stream.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe: "events"; responseType: "arraybuffer"; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<HttpEvent<ArrayBuffer>>

    Constructs a GET request that interprets the body as a Blob and returns the full event stream.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe: "events"; responseType: "blob"; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<HttpEvent<Blob>>

    Constructs a GET request that interprets the body as a text string and returns the full event stream.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe: "events"; responseType: "text"; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<HttpEvent<string>>

    Constructs a GET request that interprets the body as JSON and returns the full event stream.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe: "events"; responseType?: "json" | undefined; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<HttpEvent<Object>>

    Constructs a GET request that interprets the body as JSON and returns the full event stream.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe: "events"; responseType?: "json" | undefined; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<HttpEvent<T>>

    Constructs a GET request that interprets the body as an ArrayBuffer and returns the full HttpResponse.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe: "response"; responseType: "arraybuffer"; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<HttpResponse<ArrayBuffer>>

    Constructs a GET request that interprets the body as a Blob and returns the full HttpResponse.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe: "response"; responseType: "blob"; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<HttpResponse<Blob>>

    Constructs a GET request that interprets the body as a text stream and returns the full HttpResponse.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe: "response"; responseType: "text"; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<HttpResponse<string>>

    Constructs a GET request that interprets the body as JSON and returns the full HttpResponse.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe: "response"; responseType?: "json" | undefined; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<HttpResponse<Object>>

    Constructs a GET request that interprets the body as JSON and returns the full HttpResponse with the response body in the requested type.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe: "response"; responseType?: "json" | undefined; } & HttpClientCommonOptions

    The HTTP options to send with the request.

    @returnsObservable<HttpResponse<T>>

    Constructs a GET request that interprets the body as JSON and returns the response body as an object parsed from JSON.

    @paramurlstring

    The endpoint URL.

    @paramoptions({ observe?: "body" | undefined; responseType?: "json" | undefined; } & HttpClientCommonOptions) | undefined

    The HTTP options to send with the request.

    @returnsObservable<Object>

    Constructs a GET request that interprets the body as JSON and returns the response body in a given type.

    @paramurlstring

    The endpoint URL.

    @paramoptions({ observe?: "body" | undefined; responseType?: "json" | undefined; } & HttpClientCommonOptions) | undefined

    The HTTP options to send with the request.

    @returnsObservable<T>

    jsonp

    2 overloads

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

    @deprecated

    JSONP is deprecated as it can cause XSS vulnerabilities. Use standard HTTP requests instead. Intent to remove in future versions of Angular.

    @paramurlstring

    The resource URL.

    @paramcallbackParamstring

    The callback function name.

    @returnsObservable<Object>

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

    @deprecated

    JSONP is deprecated as it can cause XSS vulnerabilities. Use standard HTTP requests instead. Intent to remove in future versions of Angular.

    @paramurlstring

    The resource URL.

    @paramcallbackParamstring

    The callback function name.

    You must install a suitable interceptor, such as one provided by HttpClientJsonpModule. If no such interceptor is reached, then the JSONP request can be rejected by the configured backend.

    @returnsObservable<T>

    options

    15 overloads

    Constructs an OPTIONS request that interprets the body as an ArrayBuffer and returns the response as an ArrayBuffer.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe?: "body" | undefined; responseType: "arraybuffer"; } & HttpClientCommonOptions

    HTTP options.

    @returnsObservable<ArrayBuffer>

    Constructs an `OPTIONS` request that interprets the body as a `Blob` and returns the response as a `Blob`.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe?: "body" | undefined; responseType: "blob"; } & HttpClientCommonOptions

    HTTP options.

    @returnsObservable<Blob>

    Constructs an `OPTIONS` request that interprets the body as a text string and returns a string value.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe?: "body" | undefined; responseType: "text"; } & HttpClientCommonOptions

    HTTP options.

    @returnsObservable<string>

    Constructs an OPTIONS request that interprets the body as an ArrayBuffer and returns the full event stream.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe: "events"; responseType: "arraybuffer"; } & HttpClientCommonOptions

    HTTP options.

    @returnsObservable<HttpEvent<ArrayBuffer>>

    Constructs an `OPTIONS` request that interprets the body as a `Blob` and returns the full event stream.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe: "events"; responseType: "blob"; } & HttpClientCommonOptions

    HTTP options.

    @returnsObservable<HttpEvent<Blob>>

    Constructs an `OPTIONS` request that interprets the body as a text string and returns the full event stream.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe: "events"; responseType: "text"; } & HttpClientCommonOptions

    HTTP options.

    @returnsObservable<HttpEvent<string>>

    Constructs an `OPTIONS` request that interprets the body as JSON and returns the full event stream.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe: "events"; responseType?: "json" | undefined; } & HttpClientCommonOptions

    HTTP options.

    @returnsObservable<HttpEvent<Object>>

    Constructs an `OPTIONS` request that interprets the body as JSON and returns the full event stream.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe: "events"; responseType?: "json" | undefined; } & HttpClientCommonOptions

    HTTP options.

    @returnsObservable<HttpEvent<T>>

    Constructs an OPTIONS request that interprets the body as an ArrayBuffer and returns the full HTTP response.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe: "response"; responseType: "arraybuffer"; } & HttpClientCommonOptions

    HTTP options.

    @returnsObservable<HttpResponse<ArrayBuffer>>

    Constructs an `OPTIONS` request that interprets the body as a `Blob` and returns the full `HttpResponse`.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe: "response"; responseType: "blob"; } & HttpClientCommonOptions

    HTTP options.

    @returnsObservable<HttpResponse<Blob>>

    Constructs an `OPTIONS` request that interprets the body as text stream and returns the full `HttpResponse`.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe: "response"; responseType: "text"; } & HttpClientCommonOptions

    HTTP options.

    @returnsObservable<HttpResponse<string>>

    Constructs an `OPTIONS` request that interprets the body as JSON and returns the full `HttpResponse`.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe: "response"; responseType?: "json" | undefined; } & HttpClientCommonOptions

    HTTP options.

    @returnsObservable<HttpResponse<Object>>

    Constructs an `OPTIONS` request that interprets the body as JSON and returns the full `HttpResponse`.

    @paramurlstring

    The endpoint URL.

    @paramoptions{ observe: "response"; responseType?: "json" | undefined; } & HttpClientCommonOptions

    HTTP options.

    @returnsObservable<HttpResponse<T>>

    Constructs an `OPTIONS` request that interprets the body as JSON and returns the response body as an object parsed from JSON.

    @paramurlstring

    The endpoint URL.

    @paramoptionsHttpClientCommonOptions | undefined

    HTTP options.

    @returnsObservable<Object>

    Constructs an `OPTIONS` request that interprets the body as JSON and returns the response in a given type.

    @paramurlstring

    The endpoint URL.

    @paramoptionsHttpClientCommonOptions | undefined

    HTTP options.

    @returnsObservable<T>

    patch

    15 overloads

    Constructs a PATCH request that interprets the body as an ArrayBuffer and returns the response as an ArrayBuffer.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The resources to edit.

    @paramoptions{ observe?: "body" | undefined; responseType: "arraybuffer"; } & HttpClientCommonOptions

    HTTP options.

    @returnsObservable<ArrayBuffer>

    Constructs a `PATCH` request that interprets the body as a `Blob` and returns the response as a `Blob`.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The resources to edit.

    @paramoptions{ observe?: "body" | undefined; responseType: "blob"; } & HttpClientCommonOptions

    HTTP options.

    @returnsObservable<Blob>

    Constructs a `PATCH` request that interprets the body as a text string and returns the response as a string value.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The resources to edit.

    @paramoptions{ observe?: "body" | undefined; responseType: "text"; } & HttpClientCommonOptions

    HTTP options.

    @returnsObservable<string>

    Constructs a PATCH request that interprets the body as an ArrayBuffer and returns the full event stream.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The resources to edit.

    @paramoptions{ observe: "events"; responseType: "arraybuffer"; } & HttpClientCommonOptions

    HTTP options.

    @returnsObservable<HttpEvent<ArrayBuffer>>

    Constructs a PATCH request that interprets the body as a Blob and returns the full event stream.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The resources to edit.

    @paramoptions{ observe: "events"; responseType: "blob"; } & HttpClientCommonOptions

    HTTP options.

    @returnsObservable<HttpEvent<Blob>>

    Constructs a PATCH request that interprets the body as a text string and returns the full event stream.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The resources to edit.

    @paramoptions{ observe: "events"; responseType: "text"; } & HttpClientCommonOptions

    HTTP options.

    @returnsObservable<HttpEvent<string>>

    Constructs a PATCH request that interprets the body as JSON and returns the full event stream.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The resources to edit.

    @paramoptions{ observe: "events"; responseType?: "json" | undefined; } & HttpClientCommonOptions

    HTTP options.

    @returnsObservable<HttpEvent<Object>>

    Constructs a PATCH request that interprets the body as JSON and returns the full event stream.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The resources to edit.

    @paramoptions{ observe: "events"; responseType?: "json" | undefined; } & HttpClientCommonOptions

    HTTP options.

    @returnsObservable<HttpEvent<T>>

    Constructs a PATCH request that interprets the body as an ArrayBuffer and returns the full HttpResponse.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The resources to edit.

    @paramoptions{ observe: "response"; responseType: "arraybuffer"; } & HttpClientCommonOptions

    HTTP options.

    @returnsObservable<HttpResponse<ArrayBuffer>>

    Constructs a PATCH request that interprets the body as a Blob and returns the full HttpResponse.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The resources to edit.

    @paramoptions{ observe: "response"; responseType: "blob"; } & HttpClientCommonOptions

    HTTP options.

    @returnsObservable<HttpResponse<Blob>>

    Constructs a PATCH request that interprets the body as a text stream and returns the full HttpResponse.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The resources to edit.

    @paramoptions{ observe: "response"; responseType: "text"; } & HttpClientCommonOptions

    HTTP options.

    @returnsObservable<HttpResponse<string>>

    Constructs a PATCH request that interprets the body as JSON and returns the full HttpResponse.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The resources to edit.

    @paramoptions{ observe: "response"; responseType?: "json" | undefined; } & HttpClientCommonOptions

    HTTP options.

    @returnsObservable<HttpResponse<Object>>

    Constructs a PATCH request that interprets the body as JSON and returns the full HttpResponse.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The resources to edit.

    @paramoptions{ observe: "response"; responseType?: "json" | undefined; } & HttpClientCommonOptions

    HTTP options.

    @returnsObservable<HttpResponse<T>>

    Constructs a `PATCH` request that interprets the body as JSON and returns the response body as an object parsed from JSON.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The resources to edit.

    @paramoptionsHttpClientCommonOptions | undefined

    HTTP options.

    @returnsObservable<Object>

    Constructs a `PATCH` request that interprets the body as JSON and returns the response in a given type.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The resources to edit.

    @paramoptionsHttpClientCommonOptions | undefined

    HTTP options.

    @returnsObservable<T>

    post

    15 overloads

    Constructs a POST request that interprets the body as an ArrayBuffer and returns an ArrayBuffer.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The content to replace with.

    @paramoptions{ observe?: "body" | undefined; responseType: "arraybuffer"; } & HttpClientCommonOptions

    HTTP options.

    @returnsObservable<ArrayBuffer>

    Constructs a `POST` request that interprets the body as a `Blob` and returns the response as a `Blob`.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The content to replace with.

    @paramoptions{ observe?: "body" | undefined; responseType: "blob"; } & HttpClientCommonOptions

    HTTP options

    @returnsObservable<Blob>

    Constructs a `POST` request that interprets the body as a text string and returns the response as a string value.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The content to replace with.

    @paramoptions{ observe?: "body" | undefined; responseType: "text"; } & HttpClientCommonOptions

    HTTP options

    @returnsObservable<string>

    Constructs a POST request that interprets the body as an ArrayBuffer and returns the full event stream.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The content to replace with.

    @paramoptions{ observe: "events"; responseType: "arraybuffer"; } & HttpClientCommonOptions

    HTTP options

    @returnsObservable<HttpEvent<ArrayBuffer>>

    Constructs a POST request that interprets the body as a Blob and returns the response in an observable of the full event stream.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The content to replace with.

    @paramoptions{ observe: "events"; responseType: "blob"; } & HttpClientCommonOptions

    HTTP options

    @returnsObservable<HttpEvent<Blob>>

    Constructs a POST request that interprets the body as a text string and returns the full event stream.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The content to replace with.

    @paramoptions{ observe: "events"; responseType: "text"; } & HttpClientCommonOptions

    HTTP options

    @returnsObservable<HttpEvent<string>>

    Constructs a POST request that interprets the body as JSON and returns the full event stream.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The content to replace with.

    @paramoptions{ observe: "events"; responseType?: "json" | undefined; } & HttpClientCommonOptions

    HTTP options

    @returnsObservable<HttpEvent<Object>>

    Constructs a POST request that interprets the body as JSON and returns the full event stream.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The content to replace with.

    @paramoptions{ observe: "events"; responseType?: "json" | undefined; } & HttpClientCommonOptions

    HTTP options

    @returnsObservable<HttpEvent<T>>

    Constructs a POST request that interprets the body as an ArrayBuffer and returns the full HttpResponse.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The content to replace with.

    @paramoptions{ observe: "response"; responseType: "arraybuffer"; } & HttpClientCommonOptions

    HTTP options

    @returnsObservable<HttpResponse<ArrayBuffer>>

    Constructs a POST request that interprets the body as a Blob and returns the full HttpResponse.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The content to replace with.

    @paramoptions{ observe: "response"; responseType: "blob"; } & HttpClientCommonOptions

    HTTP options

    @returnsObservable<HttpResponse<Blob>>

    Constructs a POST request that interprets the body as a text stream and returns the full HttpResponse.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The content to replace with.

    @paramoptions{ observe: "response"; responseType: "text"; } & HttpClientCommonOptions

    HTTP options

    @returnsObservable<HttpResponse<string>>

    Constructs a POST request that interprets the body as JSON and returns the full HttpResponse.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The content to replace with.

    @paramoptions{ observe: "response"; responseType?: "json" | undefined; } & HttpClientCommonOptions

    HTTP options

    @returnsObservable<HttpResponse<Object>>

    Constructs a POST request that interprets the body as JSON and returns the full HttpResponse.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The content to replace with.

    @paramoptions{ observe: "response"; responseType?: "json" | undefined; } & HttpClientCommonOptions

    HTTP options

    @returnsObservable<HttpResponse<T>>

    Constructs a POST request that interprets the body as JSON and returns the response body as an object parsed from JSON.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The content to replace with.

    @paramoptionsHttpClientCommonOptions | undefined

    HTTP options

    @returnsObservable<Object>

    Constructs a POST request that interprets the body as JSON and returns an observable of the response.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The content to replace with.

    @paramoptionsHttpClientCommonOptions | undefined

    HTTP options

    @returnsObservable<T>

    put

    15 overloads

    Constructs a PUT request that interprets the body as an ArrayBuffer and returns the response as an ArrayBuffer.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The resources to add/update.

    @paramoptions{ observe?: "body" | undefined; responseType: "arraybuffer"; } & HttpClientCommonOptions

    HTTP options

    @returnsObservable<ArrayBuffer>

    Constructs a PUT request that interprets the body as a Blob and returns the response as a Blob.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The resources to add/update.

    @paramoptions{ observe?: "body" | undefined; responseType: "blob"; } & HttpClientCommonOptions

    HTTP options

    @returnsObservable<Blob>

    Constructs a PUT request that interprets the body as a text string and returns the response as a string value.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The resources to add/update.

    @paramoptions{ observe?: "body" | undefined; responseType: "text"; } & HttpClientCommonOptions

    HTTP options

    @returnsObservable<string>

    Constructs a PUT request that interprets the body as an ArrayBuffer and returns the full event stream.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The resources to add/update.

    @paramoptions{ observe: "events"; responseType: "arraybuffer"; } & HttpClientCommonOptions

    HTTP options

    @returnsObservable<HttpEvent<ArrayBuffer>>

    Constructs a PUT request that interprets the body as a Blob and returns the full event stream.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The resources to add/update.

    @paramoptions{ observe: "events"; responseType: "blob"; } & HttpClientCommonOptions

    HTTP options

    @returnsObservable<HttpEvent<Blob>>

    Constructs a PUT request that interprets the body as a text string and returns the full event stream.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The resources to add/update.

    @paramoptions{ observe: "events"; responseType: "text"; } & HttpClientCommonOptions

    HTTP options

    @returnsObservable<HttpEvent<string>>

    Constructs a PUT request that interprets the body as JSON and returns the full event stream.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The resources to add/update.

    @paramoptions{ observe: "events"; responseType?: "json" | undefined; } & HttpClientCommonOptions

    HTTP options

    @returnsObservable<HttpEvent<Object>>

    Constructs a PUT request that interprets the body as JSON and returns the full event stream.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The resources to add/update.

    @paramoptions{ observe: "events"; responseType?: "json" | undefined; } & HttpClientCommonOptions

    HTTP options

    @returnsObservable<HttpEvent<T>>

    Constructs a PUT request that interprets the body as an ArrayBuffer and returns an observable of the full HTTP response.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The resources to add/update.

    @paramoptions{ observe: "response"; responseType: "arraybuffer"; } & HttpClientCommonOptions

    HTTP options

    @returnsObservable<HttpResponse<ArrayBuffer>>

    Constructs a PUT request that interprets the body as a Blob and returns the full HTTP response.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The resources to add/update.

    @paramoptions{ observe: "response"; responseType: "blob"; } & HttpClientCommonOptions

    HTTP options

    @returnsObservable<HttpResponse<Blob>>

    Constructs a PUT request that interprets the body as a text stream and returns the full HTTP response.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The resources to add/update.

    @paramoptions{ observe: "response"; responseType: "text"; } & HttpClientCommonOptions

    HTTP options

    @returnsObservable<HttpResponse<string>>

    Constructs a PUT request that interprets the body as JSON and returns the full HTTP response.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The resources to add/update.

    @paramoptions{ observe: "response"; responseType?: "json" | undefined; } & HttpClientCommonOptions

    HTTP options

    @returnsObservable<HttpResponse<Object>>

    Constructs a PUT request that interprets the body as an instance of the requested type and returns the full HTTP response.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The resources to add/update.

    @paramoptions{ observe: "response"; responseType?: "json" | undefined; } & HttpClientCommonOptions

    HTTP options

    @returnsObservable<HttpResponse<T>>

    Constructs a PUT request that interprets the body as JSON and returns an observable of JavaScript object.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The resources to add/update.

    @paramoptionsHttpClientCommonOptions | undefined

    HTTP options

    @returnsObservable<Object>

    Constructs a PUT request that interprets the body as an instance of the requested type and returns an observable of the requested type.

    @paramurlstring

    The endpoint URL.

    @parambodyany

    The resources to add/update.

    @paramoptionsHttpClientCommonOptions | undefined

    HTTP options

    @returnsObservable<T>

    Description

    Performs HTTP requests. This service is available as an injectable class, with methods to perform HTTP requests. Each request method has multiple signatures, and the return type varies based on the signature that is called (mainly the values of observe and responseType).

    Note that the responseType options value is a String that identifies the single data type of the response. A single overload version of the method handles each response type. The value of responseType cannot be a union, as the combined signature could imply.

    Usage Notes

    HTTP Request Example

    // GET heroes whose name contains search term
    searchHeroes(term: string): observable<Hero[]>{
    
     const params = new HttpParams({fromString: 'name=term'});
       return this.httpClient.request('GET', this.heroesUrl, {responseType:'json', params});
    }

    Alternatively, the parameter string can be used without invoking HttpParams by directly joining to the URL.

    this.httpClient.request('GET', this.heroesUrl + '?' + 'name=term', {responseType:'json'});

    PATCH Example

    // PATCH one of the heroes' name
    patchHero (id: number, heroName: string): Observable<{}> {
    const url = `${this.heroesUrl}/${id}`;   // PATCH api/heroes/42
     return this.httpClient.patch(url, {name: heroName}, httpOptions)
       .pipe(catchError(this.handleError('patchHero')));
    }
    Jump to details

    Web Proxy Viewer  |  New URL  |  Original Page