source: trip-planner-front/node_modules/@angular/common/http/http.d.ts@ 6a3a178

Last change on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 138.1 KB
Line 
1/**
2 * @license Angular v12.2.9
3 * (c) 2010-2021 Google LLC. https://angular.io/
4 * License: MIT
5 */
6
7import { InjectionToken } from '@angular/core';
8import { Injector } from '@angular/core';
9import { ModuleWithProviders } from '@angular/core';
10import { Observable } from 'rxjs';
11import { XhrFactory as XhrFactory_2 } from '@angular/common';
12
13/**
14 * A multi-provider token that represents the array of registered
15 * `HttpInterceptor` objects.
16 *
17 * @publicApi
18 */
19import * as ɵngcc0 from '@angular/core';
20export declare const HTTP_INTERCEPTORS: InjectionToken<HttpInterceptor[]>;
21
22/**
23 * A final `HttpHandler` which will dispatch the request via browser HTTP APIs to a backend.
24 *
25 * Interceptors sit between the `HttpClient` interface and the `HttpBackend`.
26 *
27 * When injected, `HttpBackend` dispatches requests directly to the backend, without going
28 * through the interceptor chain.
29 *
30 * @publicApi
31 */
32export declare abstract class HttpBackend implements HttpHandler {
33 abstract handle(req: HttpRequest<any>): Observable<HttpEvent<any>>;
34}
35
36/**
37 * Performs HTTP requests.
38 * This service is available as an injectable class, with methods to perform HTTP requests.
39 * Each request method has multiple signatures, and the return type varies based on
40 * the signature that is called (mainly the values of `observe` and `responseType`).
41 *
42 * Note that the `responseType` *options* value is a String that identifies the
43 * single data type of the response.
44 * A single overload version of the method handles each response type.
45 * The value of `responseType` cannot be a union, as the combined signature could imply.
46
47 *
48 * @usageNotes
49 * Sample HTTP requests for the [Tour of Heroes](/tutorial/toh-pt0) application.
50 *
51 * ### HTTP Request Example
52 *
53 * ```
54 * // GET heroes whose name contains search term
55 * searchHeroes(term: string): observable<Hero[]>{
56 *
57 * const params = new HttpParams({fromString: 'name=term'});
58 * return this.httpClient.request('GET', this.heroesUrl, {responseType:'json', params});
59 * }
60 * ```
61 *
62 * Alternatively, the parameter string can be used without invoking HttpParams
63 * by directly joining to the URL.
64 * ```
65 * this.httpClient.request('GET', this.heroesUrl + '?' + 'name=term', {responseType:'json'});
66 * ```
67 *
68 *
69 * ### JSONP Example
70 * ```
71 * requestJsonp(url, callback = 'callback') {
72 * return this.httpClient.jsonp(this.heroesURL, callback);
73 * }
74 * ```
75 *
76 * ### PATCH Example
77 * ```
78 * // PATCH one of the heroes' name
79 * patchHero (id: number, heroName: string): Observable<{}> {
80 * const url = `${this.heroesUrl}/${id}`; // PATCH api/heroes/42
81 * return this.httpClient.patch(url, {name: heroName}, httpOptions)
82 * .pipe(catchError(this.handleError('patchHero')));
83 * }
84 * ```
85 *
86 * @see [HTTP Guide](guide/http)
87 * @see [HTTP Request](api/common/http/HttpRequest)
88 *
89 * @publicApi
90 */
91export declare class HttpClient {
92 private handler;
93 constructor(handler: HttpHandler);
94 /**
95 * Sends an `HttpRequest` and returns a stream of `HttpEvent`s.
96 *
97 * @return An `Observable` of the response, with the response body as a stream of `HttpEvent`s.
98 */
99 request<R>(req: HttpRequest<any>): Observable<HttpEvent<R>>;
100 /**
101 * Constructs a request that interprets the body as an `ArrayBuffer` and returns the response in
102 * an `ArrayBuffer`.
103 *
104 * @param method The HTTP method.
105 * @param url The endpoint URL.
106 * @param options The HTTP options to send with the request.
107 *
108 *
109 * @return An `Observable` of the response, with the response body as an `ArrayBuffer`.
110 */
111 request(method: string, url: string, options: {
112 body?: any;
113 headers?: HttpHeaders | {
114 [header: string]: string | string[];
115 };
116 context?: HttpContext;
117 observe?: 'body';
118 params?: HttpParams | {
119 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
120 };
121 reportProgress?: boolean;
122 responseType: 'arraybuffer';
123 withCredentials?: boolean;
124 }): Observable<ArrayBuffer>;
125 /**
126 * Constructs a request that interprets the body as a blob and returns
127 * the response as a blob.
128 *
129 * @param method The HTTP method.
130 * @param url The endpoint URL.
131 * @param options The HTTP options to send with the request.
132 *
133 * @return An `Observable` of the response, with the response body of type `Blob`.
134 */
135 request(method: string, url: string, options: {
136 body?: any;
137 headers?: HttpHeaders | {
138 [header: string]: string | string[];
139 };
140 context?: HttpContext;
141 observe?: 'body';
142 params?: HttpParams | {
143 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
144 };
145 reportProgress?: boolean;
146 responseType: 'blob';
147 withCredentials?: boolean;
148 }): Observable<Blob>;
149 /**
150 * Constructs a request that interprets the body as a text string and
151 * returns a string value.
152 *
153 * @param method The HTTP method.
154 * @param url The endpoint URL.
155 * @param options The HTTP options to send with the request.
156 *
157 * @return An `Observable` of the response, with the response body of type string.
158 */
159 request(method: string, url: string, options: {
160 body?: any;
161 headers?: HttpHeaders | {
162 [header: string]: string | string[];
163 };
164 context?: HttpContext;
165 observe?: 'body';
166 params?: HttpParams | {
167 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
168 };
169 reportProgress?: boolean;
170 responseType: 'text';
171 withCredentials?: boolean;
172 }): Observable<string>;
173 /**
174 * Constructs a request that interprets the body as an `ArrayBuffer` and returns the
175 * the full event stream.
176 *
177 * @param method The HTTP method.
178 * @param url The endpoint URL.
179 * @param options The HTTP options to send with the request.
180 *
181 * @return An `Observable` of the response, with the response body as an array of `HttpEvent`s for
182 * the request.
183 */
184 request(method: string, url: string, options: {
185 body?: any;
186 headers?: HttpHeaders | {
187 [header: string]: string | string[];
188 };
189 context?: HttpContext;
190 params?: HttpParams | {
191 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
192 };
193 observe: 'events';
194 reportProgress?: boolean;
195 responseType: 'arraybuffer';
196 withCredentials?: boolean;
197 }): Observable<HttpEvent<ArrayBuffer>>;
198 /**
199 * Constructs a request that interprets the body as a `Blob` and returns
200 * the full event stream.
201 *
202 * @param method The HTTP method.
203 * @param url The endpoint URL.
204 * @param options The HTTP options to send with the request.
205 *
206 * @return An `Observable` of all `HttpEvent`s for the request,
207 * with the response body of type `Blob`.
208 */
209 request(method: string, url: string, options: {
210 body?: any;
211 headers?: HttpHeaders | {
212 [header: string]: string | string[];
213 };
214 observe: 'events';
215 context?: HttpContext;
216 params?: HttpParams | {
217 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
218 };
219 reportProgress?: boolean;
220 responseType: 'blob';
221 withCredentials?: boolean;
222 }): Observable<HttpEvent<Blob>>;
223 /**
224 * Constructs a request which interprets the body as a text string and returns the full event
225 * stream.
226 *
227 * @param method The HTTP method.
228 * @param url The endpoint URL.
229 * @param options The HTTP options to send with the request.
230 *
231 * @return An `Observable` of all `HttpEvent`s for the request,
232 * with the response body of type string.
233 */
234 request(method: string, url: string, options: {
235 body?: any;
236 headers?: HttpHeaders | {
237 [header: string]: string | string[];
238 };
239 observe: 'events';
240 context?: HttpContext;
241 params?: HttpParams | {
242 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
243 };
244 reportProgress?: boolean;
245 responseType: 'text';
246 withCredentials?: boolean;
247 }): Observable<HttpEvent<string>>;
248 /**
249 * Constructs a request which interprets the body as a JSON object and returns the full event
250 * stream.
251 *
252 * @param method The HTTP method.
253 * @param url The endpoint URL.
254 * @param options The HTTP options to send with the request.
255 *
256 * @return An `Observable` of all `HttpEvent`s for the request,
257 * with the response body of type `Object`.
258 */
259 request(method: string, url: string, options: {
260 body?: any;
261 headers?: HttpHeaders | {
262 [header: string]: string | string[];
263 };
264 context?: HttpContext;
265 reportProgress?: boolean;
266 observe: 'events';
267 params?: HttpParams | {
268 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
269 };
270 responseType?: 'json';
271 withCredentials?: boolean;
272 }): Observable<HttpEvent<any>>;
273 /**
274 * Constructs a request which interprets the body as a JSON object and returns the full event
275 * stream.
276 *
277 * @param method The HTTP method.
278 * @param url The endpoint URL.
279 * @param options The HTTP options to send with the request.
280 *
281 * @return An `Observable` of all `HttpEvent`s for the request,
282 * with the response body of type `R`.
283 */
284 request<R>(method: string, url: string, options: {
285 body?: any;
286 headers?: HttpHeaders | {
287 [header: string]: string | string[];
288 };
289 context?: HttpContext;
290 reportProgress?: boolean;
291 observe: 'events';
292 params?: HttpParams | {
293 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
294 };
295 responseType?: 'json';
296 withCredentials?: boolean;
297 }): Observable<HttpEvent<R>>;
298 /**
299 * Constructs a request which interprets the body as an `ArrayBuffer`
300 * and returns the full `HttpResponse`.
301 *
302 * @param method The HTTP method.
303 * @param url The endpoint URL.
304 * @param options The HTTP options to send with the request.
305 *
306 * @return An `Observable` of the `HttpResponse`, with the response body as an `ArrayBuffer`.
307 */
308 request(method: string, url: string, options: {
309 body?: any;
310 headers?: HttpHeaders | {
311 [header: string]: string | string[];
312 };
313 observe: 'response';
314 context?: HttpContext;
315 params?: HttpParams | {
316 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
317 };
318 reportProgress?: boolean;
319 responseType: 'arraybuffer';
320 withCredentials?: boolean;
321 }): Observable<HttpResponse<ArrayBuffer>>;
322 /**
323 * Constructs a request which interprets the body as a `Blob` and returns the full `HttpResponse`.
324 *
325 * @param method The HTTP method.
326 * @param url The endpoint URL.
327 * @param options The HTTP options to send with the request.
328 *
329 * @return An `Observable` of the `HttpResponse`, with the response body of type `Blob`.
330 */
331 request(method: string, url: string, options: {
332 body?: any;
333 headers?: HttpHeaders | {
334 [header: string]: string | string[];
335 };
336 observe: 'response';
337 context?: HttpContext;
338 params?: HttpParams | {
339 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
340 };
341 reportProgress?: boolean;
342 responseType: 'blob';
343 withCredentials?: boolean;
344 }): Observable<HttpResponse<Blob>>;
345 /**
346 * Constructs a request which interprets the body as a text stream and returns the full
347 * `HttpResponse`.
348 *
349 * @param method The HTTP method.
350 * @param url The endpoint URL.
351 * @param options The HTTP options to send with the request.
352 *
353 * @return An `Observable` of the HTTP response, with the response body of type string.
354 */
355 request(method: string, url: string, options: {
356 body?: any;
357 headers?: HttpHeaders | {
358 [header: string]: string | string[];
359 };
360 observe: 'response';
361 context?: HttpContext;
362 params?: HttpParams | {
363 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
364 };
365 reportProgress?: boolean;
366 responseType: 'text';
367 withCredentials?: boolean;
368 }): Observable<HttpResponse<string>>;
369 /**
370 * Constructs a request which interprets the body as a JSON object and returns the full
371 * `HttpResponse`.
372 *
373 * @param method The HTTP method.
374 * @param url The endpoint URL.
375 * @param options The HTTP options to send with the request.
376 *
377 * @return An `Observable` of the full `HttpResponse`,
378 * with the response body of type `Object`.
379 */
380 request(method: string, url: string, options: {
381 body?: any;
382 headers?: HttpHeaders | {
383 [header: string]: string | string[];
384 };
385 context?: HttpContext;
386 reportProgress?: boolean;
387 observe: 'response';
388 params?: HttpParams | {
389 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
390 };
391 responseType?: 'json';
392 withCredentials?: boolean;
393 }): Observable<HttpResponse<Object>>;
394 /**
395 * Constructs a request which interprets the body as a JSON object and returns
396 * the full `HttpResponse` with the response body in the requested type.
397 *
398 * @param method The HTTP method.
399 * @param url The endpoint URL.
400 * @param options The HTTP options to send with the request.
401 *
402 * @return An `Observable` of the full `HttpResponse`, with the response body of type `R`.
403 */
404 request<R>(method: string, url: string, options: {
405 body?: any;
406 headers?: HttpHeaders | {
407 [header: string]: string | string[];
408 };
409 context?: HttpContext;
410 reportProgress?: boolean;
411 observe: 'response';
412 params?: HttpParams | {
413 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
414 };
415 responseType?: 'json';
416 withCredentials?: boolean;
417 }): Observable<HttpResponse<R>>;
418 /**
419 * Constructs a request which interprets the body as a JSON object and returns the full
420 * `HttpResponse` as a JSON object.
421 *
422 * @param method The HTTP method.
423 * @param url The endpoint URL.
424 * @param options The HTTP options to send with the request.
425 *
426 * @return An `Observable` of the `HttpResponse`, with the response body of type `Object`.
427 */
428 request(method: string, url: string, options?: {
429 body?: any;
430 headers?: HttpHeaders | {
431 [header: string]: string | string[];
432 };
433 context?: HttpContext;
434 observe?: 'body';
435 params?: HttpParams | {
436 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
437 };
438 responseType?: 'json';
439 reportProgress?: boolean;
440 withCredentials?: boolean;
441 }): Observable<Object>;
442 /**
443 * Constructs a request which interprets the body as a JSON object
444 * with the response body of the requested type.
445 *
446 * @param method The HTTP method.
447 * @param url The endpoint URL.
448 * @param options The HTTP options to send with the request.
449 *
450 * @return An `Observable` of the `HttpResponse`, with the response body of type `R`.
451 */
452 request<R>(method: string, url: string, options?: {
453 body?: any;
454 headers?: HttpHeaders | {
455 [header: string]: string | string[];
456 };
457 context?: HttpContext;
458 observe?: 'body';
459 params?: HttpParams | {
460 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
461 };
462 responseType?: 'json';
463 reportProgress?: boolean;
464 withCredentials?: boolean;
465 }): Observable<R>;
466 /**
467 * Constructs a request where response type and requested observable are not known statically.
468 *
469 * @param method The HTTP method.
470 * @param url The endpoint URL.
471 * @param options The HTTP options to send with the request.
472 *
473 * @return An `Observable` of the requested response, with body of type `any`.
474 */
475 request(method: string, url: string, options?: {
476 body?: any;
477 headers?: HttpHeaders | {
478 [header: string]: string | string[];
479 };
480 context?: HttpContext;
481 params?: HttpParams | {
482 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
483 };
484 observe?: 'body' | 'events' | 'response';
485 reportProgress?: boolean;
486 responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
487 withCredentials?: boolean;
488 }): Observable<any>;
489 /**
490 * Constructs a `DELETE` request that interprets the body as an `ArrayBuffer`
491 * and returns the response as an `ArrayBuffer`.
492 *
493 * @param url The endpoint URL.
494 * @param options The HTTP options to send with the request.
495 *
496 * @return An `Observable` of the response body as an `ArrayBuffer`.
497 */
498 delete(url: string, options: {
499 headers?: HttpHeaders | {
500 [header: string]: string | string[];
501 };
502 context?: HttpContext;
503 observe?: 'body';
504 params?: HttpParams | {
505 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
506 };
507 reportProgress?: boolean;
508 responseType: 'arraybuffer';
509 withCredentials?: boolean;
510 body?: any | null;
511 }): Observable<ArrayBuffer>;
512 /**
513 * Constructs a `DELETE` request that interprets the body as a `Blob` and returns
514 * the response as a `Blob`.
515 *
516 * @param url The endpoint URL.
517 * @param options The HTTP options to send with the request.
518 *
519 * @return An `Observable` of the response body as a `Blob`.
520 */
521 delete(url: string, options: {
522 headers?: HttpHeaders | {
523 [header: string]: string | string[];
524 };
525 context?: HttpContext;
526 observe?: 'body';
527 params?: HttpParams | {
528 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
529 };
530 reportProgress?: boolean;
531 responseType: 'blob';
532 withCredentials?: boolean;
533 body?: any | null;
534 }): Observable<Blob>;
535 /**
536 * Constructs a `DELETE` request that interprets the body as a text string and returns
537 * a string.
538 *
539 * @param url The endpoint URL.
540 * @param options The HTTP options to send with the request.
541 *
542 * @return An `Observable` of the response, with the response body of type string.
543 */
544 delete(url: string, options: {
545 headers?: HttpHeaders | {
546 [header: string]: string | string[];
547 };
548 context?: HttpContext;
549 observe?: 'body';
550 params?: HttpParams | {
551 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
552 };
553 reportProgress?: boolean;
554 responseType: 'text';
555 withCredentials?: boolean;
556 body?: any | null;
557 }): Observable<string>;
558 /**
559 * Constructs a `DELETE` request that interprets the body as an `ArrayBuffer`
560 * and returns the full event stream.
561 *
562 * @param url The endpoint URL.
563 * @param options The HTTP options to send with the request.
564 *
565 * @return An `Observable` of all `HttpEvent`s for the request,
566 * with response body as an `ArrayBuffer`.
567 */
568 delete(url: string, options: {
569 headers?: HttpHeaders | {
570 [header: string]: string | string[];
571 };
572 observe: 'events';
573 context?: HttpContext;
574 params?: HttpParams | {
575 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
576 };
577 reportProgress?: boolean;
578 responseType: 'arraybuffer';
579 withCredentials?: boolean;
580 body?: any | null;
581 }): Observable<HttpEvent<ArrayBuffer>>;
582 /**
583 * Constructs a `DELETE` request that interprets the body as a `Blob`
584 * and returns the full event stream.
585 *
586 * @param url The endpoint URL.
587 * @param options The HTTP options to send with the request.
588 *
589 * @return An `Observable` of all the `HttpEvent`s for the request, with the response body as a
590 * `Blob`.
591 */
592 delete(url: string, options: {
593 headers?: HttpHeaders | {
594 [header: string]: string | string[];
595 };
596 observe: 'events';
597 context?: HttpContext;
598 params?: HttpParams | {
599 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
600 };
601 reportProgress?: boolean;
602 responseType: 'blob';
603 withCredentials?: boolean;
604 body?: any | null;
605 }): Observable<HttpEvent<Blob>>;
606 /**
607 * Constructs a `DELETE` request that interprets the body as a text string
608 * and returns the full event stream.
609 *
610 * @param url The endpoint URL.
611 * @param options The HTTP options to send with the request.
612 *
613 * @return An `Observable` of all `HttpEvent`s for the request, with the response
614 * body of type string.
615 */
616 delete(url: string, options: {
617 headers?: HttpHeaders | {
618 [header: string]: string | string[];
619 };
620 observe: 'events';
621 context?: HttpContext;
622 params?: HttpParams | {
623 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
624 };
625 reportProgress?: boolean;
626 responseType: 'text';
627 withCredentials?: boolean;
628 body?: any | null;
629 }): Observable<HttpEvent<string>>;
630 /**
631 * Constructs a `DELETE` request that interprets the body as a JSON object
632 * and returns the full event stream.
633 *
634 * @param url The endpoint URL.
635 * @param options The HTTP options to send with the request.
636 *
637 * @return An `Observable` of all `HttpEvent`s for the request, with response body of
638 * type `Object`.
639 */
640 delete(url: string, options: {
641 headers?: HttpHeaders | {
642 [header: string]: string | string[];
643 };
644 observe: 'events';
645 context?: HttpContext;
646 params?: HttpParams | {
647 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
648 };
649 reportProgress?: boolean;
650 responseType?: 'json';
651 withCredentials?: boolean;
652 body?: any | null;
653 }): Observable<HttpEvent<Object>>;
654 /**
655 * Constructs a `DELETE`request that interprets the body as a JSON object
656 * and returns the full event stream.
657 *
658 * @param url The endpoint URL.
659 * @param options The HTTP options to send with the request.
660 *
661 * @return An `Observable` of all the `HttpEvent`s for the request, with a response
662 * body in the requested type.
663 */
664 delete<T>(url: string, options: {
665 headers?: HttpHeaders | {
666 [header: string]: string | string[];
667 };
668 observe: 'events';
669 context?: HttpContext;
670 params?: HttpParams | {
671 [param: string]: string | number | boolean | (string | number | boolean)[];
672 };
673 reportProgress?: boolean;
674 responseType?: 'json';
675 withCredentials?: boolean;
676 body?: any | null;
677 }): Observable<HttpEvent<T>>;
678 /**
679 * Constructs a `DELETE` request that interprets the body as an `ArrayBuffer` and returns
680 * the full `HttpResponse`.
681 *
682 * @param url The endpoint URL.
683 * @param options The HTTP options to send with the request.
684 *
685 * @return An `Observable` of the full `HttpResponse`, with the response body as an `ArrayBuffer`.
686 */
687 delete(url: string, options: {
688 headers?: HttpHeaders | {
689 [header: string]: string | string[];
690 };
691 observe: 'response';
692 context?: HttpContext;
693 params?: HttpParams | {
694 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
695 };
696 reportProgress?: boolean;
697 responseType: 'arraybuffer';
698 withCredentials?: boolean;
699 body?: any | null;
700 }): Observable<HttpResponse<ArrayBuffer>>;
701 /**
702 * Constructs a `DELETE` request that interprets the body as a `Blob` and returns the full
703 * `HttpResponse`.
704 *
705 * @param url The endpoint URL.
706 * @param options The HTTP options to send with the request.
707 *
708 * @return An `Observable` of the `HttpResponse`, with the response body of type `Blob`.
709 */
710 delete(url: string, options: {
711 headers?: HttpHeaders | {
712 [header: string]: string | string[];
713 };
714 observe: 'response';
715 context?: HttpContext;
716 params?: HttpParams | {
717 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
718 };
719 reportProgress?: boolean;
720 responseType: 'blob';
721 withCredentials?: boolean;
722 body?: any | null;
723 }): Observable<HttpResponse<Blob>>;
724 /**
725 * Constructs a `DELETE` request that interprets the body as a text stream and
726 * returns the full `HttpResponse`.
727 *
728 * @param url The endpoint URL.
729 * @param options The HTTP options to send with the request.
730 *
731 * @return An `Observable` of the full `HttpResponse`, with the response body of type string.
732 */
733 delete(url: string, options: {
734 headers?: HttpHeaders | {
735 [header: string]: string | string[];
736 };
737 observe: 'response';
738 context?: HttpContext;
739 params?: HttpParams | {
740 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
741 };
742 reportProgress?: boolean;
743 responseType: 'text';
744 withCredentials?: boolean;
745 body?: any | null;
746 }): Observable<HttpResponse<string>>;
747 /**
748 * Constructs a `DELETE` request the interprets the body as a JSON object and returns
749 * the full `HttpResponse`.
750 *
751 * @param url The endpoint URL.
752 * @param options The HTTP options to send with the request.
753 *
754 * @return An `Observable` of the `HttpResponse`, with the response body of type `Object`.
755 *
756 */
757 delete(url: string, options: {
758 headers?: HttpHeaders | {
759 [header: string]: string | string[];
760 };
761 observe: 'response';
762 context?: HttpContext;
763 params?: HttpParams | {
764 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
765 };
766 reportProgress?: boolean;
767 responseType?: 'json';
768 withCredentials?: boolean;
769 body?: any | null;
770 }): Observable<HttpResponse<Object>>;
771 /**
772 * Constructs a `DELETE` request that interprets the body as a JSON object
773 * and returns the full `HttpResponse`.
774 *
775 * @param url The endpoint URL.
776 * @param options The HTTP options to send with the request.
777 *
778 * @return An `Observable` of the `HttpResponse`, with the response body of the requested type.
779 */
780 delete<T>(url: string, options: {
781 headers?: HttpHeaders | {
782 [header: string]: string | string[];
783 };
784 observe: 'response';
785 context?: HttpContext;
786 params?: HttpParams | {
787 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
788 };
789 reportProgress?: boolean;
790 responseType?: 'json';
791 withCredentials?: boolean;
792 body?: any | null;
793 }): Observable<HttpResponse<T>>;
794 /**
795 * Constructs a `DELETE` request that interprets the body as a JSON object and
796 * returns the response body as a JSON object.
797 *
798 * @param url The endpoint URL.
799 * @param options The HTTP options to send with the request.
800 *
801 * @return An `Observable` of the response, with the response body of type `Object`.
802 */
803 delete(url: string, options?: {
804 headers?: HttpHeaders | {
805 [header: string]: string | string[];
806 };
807 context?: HttpContext;
808 observe?: 'body';
809 params?: HttpParams | {
810 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
811 };
812 reportProgress?: boolean;
813 responseType?: 'json';
814 withCredentials?: boolean;
815 body?: any | null;
816 }): Observable<Object>;
817 /**
818 * Constructs a DELETE request that interprets the body as a JSON object and returns
819 * the response in a given type.
820 *
821 * @param url The endpoint URL.
822 * @param options The HTTP options to send with the request.
823 *
824 * @return An `Observable` of the `HttpResponse`, with response body in the requested type.
825 */
826 delete<T>(url: string, options?: {
827 headers?: HttpHeaders | {
828 [header: string]: string | string[];
829 };
830 context?: HttpContext;
831 observe?: 'body';
832 params?: HttpParams | {
833 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
834 };
835 reportProgress?: boolean;
836 responseType?: 'json';
837 withCredentials?: boolean;
838 body?: any | null;
839 }): Observable<T>;
840 /**
841 * Constructs a `GET` request that interprets the body as an `ArrayBuffer` and returns the
842 * response in an `ArrayBuffer`.
843 *
844 * @param url The endpoint URL.
845 * @param options The HTTP options to send with the request.
846 *
847 * @return An `Observable` of the response, with the response body as an `ArrayBuffer`.
848 */
849 get(url: string, options: {
850 headers?: HttpHeaders | {
851 [header: string]: string | string[];
852 };
853 context?: HttpContext;
854 observe?: 'body';
855 params?: HttpParams | {
856 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
857 };
858 reportProgress?: boolean;
859 responseType: 'arraybuffer';
860 withCredentials?: boolean;
861 }): Observable<ArrayBuffer>;
862 /**
863 * Constructs a `GET` request that interprets the body as a `Blob`
864 * and returns the response as a `Blob`.
865 *
866 * @param url The endpoint URL.
867 * @param options The HTTP options to send with the request.
868 *
869 * @return An `Observable` of the response, with the response body as a `Blob`.
870 */
871 get(url: string, options: {
872 headers?: HttpHeaders | {
873 [header: string]: string | string[];
874 };
875 context?: HttpContext;
876 observe?: 'body';
877 params?: HttpParams | {
878 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
879 };
880 reportProgress?: boolean;
881 responseType: 'blob';
882 withCredentials?: boolean;
883 }): Observable<Blob>;
884 /**
885 * Constructs a `GET` request that interprets the body as a text string
886 * and returns the response as a string value.
887 *
888 * @param url The endpoint URL.
889 * @param options The HTTP options to send with the request.
890 *
891 * @return An `Observable` of the response, with the response body of type string.
892 */
893 get(url: string, options: {
894 headers?: HttpHeaders | {
895 [header: string]: string | string[];
896 };
897 context?: HttpContext;
898 observe?: 'body';
899 params?: HttpParams | {
900 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
901 };
902 reportProgress?: boolean;
903 responseType: 'text';
904 withCredentials?: boolean;
905 }): Observable<string>;
906 /**
907 * Constructs a `GET` request that interprets the body as an `ArrayBuffer` and returns
908 * the full event stream.
909 *
910 * @param url The endpoint URL.
911 * @param options The HTTP options to send with the request.
912 *
913 * @return An `Observable` of all `HttpEvent`s for the request, with the response
914 * body as an `ArrayBuffer`.
915 */
916 get(url: string, options: {
917 headers?: HttpHeaders | {
918 [header: string]: string | string[];
919 };
920 observe: 'events';
921 context?: HttpContext;
922 params?: HttpParams | {
923 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
924 };
925 reportProgress?: boolean;
926 responseType: 'arraybuffer';
927 withCredentials?: boolean;
928 }): Observable<HttpEvent<ArrayBuffer>>;
929 /**
930 * Constructs a `GET` request that interprets the body as a `Blob` and
931 * returns the full event stream.
932 *
933 * @param url The endpoint URL.
934 * @param options The HTTP options to send with the request.
935 *
936 * @return An `Observable` of the response, with the response body as a `Blob`.
937 */
938 get(url: string, options: {
939 headers?: HttpHeaders | {
940 [header: string]: string | string[];
941 };
942 observe: 'events';
943 context?: HttpContext;
944 params?: HttpParams | {
945 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
946 };
947 reportProgress?: boolean;
948 responseType: 'blob';
949 withCredentials?: boolean;
950 }): Observable<HttpEvent<Blob>>;
951 /**
952 * Constructs a `GET` request that interprets the body as a text string and returns
953 * the full event stream.
954 *
955 * @param url The endpoint URL.
956 * @param options The HTTP options to send with the request.
957 *
958 * @return An `Observable` of the response, with the response body of type string.
959 */
960 get(url: string, options: {
961 headers?: HttpHeaders | {
962 [header: string]: string | string[];
963 };
964 observe: 'events';
965 context?: HttpContext;
966 params?: HttpParams | {
967 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
968 };
969 reportProgress?: boolean;
970 responseType: 'text';
971 withCredentials?: boolean;
972 }): Observable<HttpEvent<string>>;
973 /**
974 * Constructs a `GET` request that interprets the body as a JSON object
975 * and returns the full event stream.
976 *
977 * @param url The endpoint URL.
978 * @param options The HTTP options to send with the request.
979 *
980 * @return An `Observable` of the response, with the response body of type `Object`.
981 */
982 get(url: string, options: {
983 headers?: HttpHeaders | {
984 [header: string]: string | string[];
985 };
986 observe: 'events';
987 context?: HttpContext;
988 params?: HttpParams | {
989 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
990 };
991 reportProgress?: boolean;
992 responseType?: 'json';
993 withCredentials?: boolean;
994 }): Observable<HttpEvent<Object>>;
995 /**
996 * Constructs a `GET` request that interprets the body as a JSON object and returns the full event
997 * stream.
998 *
999 * @param url The endpoint URL.
1000 * @param options The HTTP options to send with the request.
1001 *
1002 * @return An `Observable` of the response, with a response body in the requested type.
1003 */
1004 get<T>(url: string, options: {
1005 headers?: HttpHeaders | {
1006 [header: string]: string | string[];
1007 };
1008 observe: 'events';
1009 context?: HttpContext;
1010 params?: HttpParams | {
1011 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1012 };
1013 reportProgress?: boolean;
1014 responseType?: 'json';
1015 withCredentials?: boolean;
1016 }): Observable<HttpEvent<T>>;
1017 /**
1018 * Constructs a `GET` request that interprets the body as an `ArrayBuffer` and
1019 * returns the full `HttpResponse`.
1020 *
1021 * @param url The endpoint URL.
1022 * @param options The HTTP options to send with the request.
1023 *
1024 * @return An `Observable` of the `HttpResponse` for the request,
1025 * with the response body as an `ArrayBuffer`.
1026 */
1027 get(url: string, options: {
1028 headers?: HttpHeaders | {
1029 [header: string]: string | string[];
1030 };
1031 observe: 'response';
1032 context?: HttpContext;
1033 params?: HttpParams | {
1034 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1035 };
1036 reportProgress?: boolean;
1037 responseType: 'arraybuffer';
1038 withCredentials?: boolean;
1039 }): Observable<HttpResponse<ArrayBuffer>>;
1040 /**
1041 * Constructs a `GET` request that interprets the body as a `Blob` and
1042 * returns the full `HttpResponse`.
1043 *
1044 * @param url The endpoint URL.
1045 * @param options The HTTP options to send with the request.
1046 *
1047 * @return An `Observable` of the `HttpResponse` for the request,
1048 * with the response body as a `Blob`.
1049 */
1050 get(url: string, options: {
1051 headers?: HttpHeaders | {
1052 [header: string]: string | string[];
1053 };
1054 observe: 'response';
1055 context?: HttpContext;
1056 params?: HttpParams | {
1057 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1058 };
1059 reportProgress?: boolean;
1060 responseType: 'blob';
1061 withCredentials?: boolean;
1062 }): Observable<HttpResponse<Blob>>;
1063 /**
1064 * Constructs a `GET` request that interprets the body as a text stream and
1065 * returns the full `HttpResponse`.
1066 *
1067 * @param url The endpoint URL.
1068 * @param options The HTTP options to send with the request.
1069 *
1070 * @return An `Observable` of the `HttpResponse` for the request,
1071 * with the response body of type string.
1072 */
1073 get(url: string, options: {
1074 headers?: HttpHeaders | {
1075 [header: string]: string | string[];
1076 };
1077 observe: 'response';
1078 context?: HttpContext;
1079 params?: HttpParams | {
1080 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1081 };
1082 reportProgress?: boolean;
1083 responseType: 'text';
1084 withCredentials?: boolean;
1085 }): Observable<HttpResponse<string>>;
1086 /**
1087 * Constructs a `GET` request that interprets the body as a JSON object and
1088 * returns the full `HttpResponse`.
1089 *
1090 * @param url The endpoint URL.
1091 * @param options The HTTP options to send with the request.
1092 *
1093 * @return An `Observable` of the full `HttpResponse`,
1094 * with the response body of type `Object`.
1095 */
1096 get(url: string, options: {
1097 headers?: HttpHeaders | {
1098 [header: string]: string | string[];
1099 };
1100 observe: 'response';
1101 context?: HttpContext;
1102 params?: HttpParams | {
1103 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1104 };
1105 reportProgress?: boolean;
1106 responseType?: 'json';
1107 withCredentials?: boolean;
1108 }): Observable<HttpResponse<Object>>;
1109 /**
1110 * Constructs a `GET` request that interprets the body as a JSON object and
1111 * returns the full `HttpResponse`.
1112 *
1113 * @param url The endpoint URL.
1114 * @param options The HTTP options to send with the request.
1115 *
1116 * @return An `Observable` of the full `HttpResponse` for the request,
1117 * with a response body in the requested type.
1118 */
1119 get<T>(url: string, options: {
1120 headers?: HttpHeaders | {
1121 [header: string]: string | string[];
1122 };
1123 observe: 'response';
1124 context?: HttpContext;
1125 params?: HttpParams | {
1126 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1127 };
1128 reportProgress?: boolean;
1129 responseType?: 'json';
1130 withCredentials?: boolean;
1131 }): Observable<HttpResponse<T>>;
1132 /**
1133 * Constructs a `GET` request that interprets the body as a JSON object and
1134 * returns the response body as a JSON object.
1135 *
1136 * @param url The endpoint URL.
1137 * @param options The HTTP options to send with the request.
1138 *
1139 *
1140 * @return An `Observable` of the response body as a JSON object.
1141 */
1142 get(url: string, options?: {
1143 headers?: HttpHeaders | {
1144 [header: string]: string | string[];
1145 };
1146 context?: HttpContext;
1147 observe?: 'body';
1148 params?: HttpParams | {
1149 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1150 };
1151 reportProgress?: boolean;
1152 responseType?: 'json';
1153 withCredentials?: boolean;
1154 }): Observable<Object>;
1155 /**
1156 * Constructs a `GET` request that interprets the body as a JSON object and returns
1157 * the response body in a given type.
1158 *
1159 * @param url The endpoint URL.
1160 * @param options The HTTP options to send with the request.
1161 *
1162 * @return An `Observable` of the `HttpResponse`, with a response body in the requested type.
1163 */
1164 get<T>(url: string, options?: {
1165 headers?: HttpHeaders | {
1166 [header: string]: string | string[];
1167 };
1168 context?: HttpContext;
1169 observe?: 'body';
1170 params?: HttpParams | {
1171 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1172 };
1173 reportProgress?: boolean;
1174 responseType?: 'json';
1175 withCredentials?: boolean;
1176 }): Observable<T>;
1177 /**
1178 * Constructs a `HEAD` request that interprets the body as an `ArrayBuffer` and
1179 * returns the response as an `ArrayBuffer`.
1180 *
1181 * @param url The endpoint URL.
1182 * @param options The HTTP options to send with the request.
1183 *
1184 * @return An `Observable` of the response, with the response body as an `ArrayBuffer`.
1185 */
1186 head(url: string, options: {
1187 headers?: HttpHeaders | {
1188 [header: string]: string | string[];
1189 };
1190 context?: HttpContext;
1191 observe?: 'body';
1192 params?: HttpParams | {
1193 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1194 };
1195 reportProgress?: boolean;
1196 responseType: 'arraybuffer';
1197 withCredentials?: boolean;
1198 }): Observable<ArrayBuffer>;
1199 /**
1200 * Constructs a `HEAD` request that interprets the body as a `Blob` and returns
1201 * the response as a `Blob`.
1202 *
1203 * @param url The endpoint URL.
1204 * @param options The HTTP options to send with the request.
1205 *
1206 * @return An `Observable` of the response, with the response body as a `Blob`.
1207 */
1208 head(url: string, options: {
1209 headers?: HttpHeaders | {
1210 [header: string]: string | string[];
1211 };
1212 context?: HttpContext;
1213 observe?: 'body';
1214 params?: HttpParams | {
1215 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1216 };
1217 reportProgress?: boolean;
1218 responseType: 'blob';
1219 withCredentials?: boolean;
1220 }): Observable<Blob>;
1221 /**
1222 * Constructs a `HEAD` request that interprets the body as a text string and returns the response
1223 * as a string value.
1224 *
1225 * @param url The endpoint URL.
1226 * @param options The HTTP options to send with the request.
1227 *
1228 * @return An `Observable` of the response, with the response body of type string.
1229 */
1230 head(url: string, options: {
1231 headers?: HttpHeaders | {
1232 [header: string]: string | string[];
1233 };
1234 context?: HttpContext;
1235 observe?: 'body';
1236 params?: HttpParams | {
1237 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1238 };
1239 reportProgress?: boolean;
1240 responseType: 'text';
1241 withCredentials?: boolean;
1242 }): Observable<string>;
1243 /**
1244 * Constructs a `HEAD` request that interprets the body as an `ArrayBuffer`
1245 * and returns the full event stream.
1246 *
1247 * @param url The endpoint URL.
1248 * @param options The HTTP options to send with the request.
1249 *
1250 * @return An `Observable` of all `HttpEvent`s for the request,
1251 * with the response body as an `ArrayBuffer`.
1252 */
1253 head(url: string, options: {
1254 headers?: HttpHeaders | {
1255 [header: string]: string | string[];
1256 };
1257 observe: 'events';
1258 context?: HttpContext;
1259 params?: HttpParams | {
1260 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1261 };
1262 reportProgress?: boolean;
1263 responseType: 'arraybuffer';
1264 withCredentials?: boolean;
1265 }): Observable<HttpEvent<ArrayBuffer>>;
1266 /**
1267 * Constructs a `HEAD` request that interprets the body as a `Blob` and
1268 * returns the full event stream.
1269 *
1270 * @param url The endpoint URL.
1271 * @param options The HTTP options to send with the request.
1272 *
1273 * @return An `Observable` of all `HttpEvent`s for the request,
1274 * with the response body as a `Blob`.
1275 */
1276 head(url: string, options: {
1277 headers?: HttpHeaders | {
1278 [header: string]: string | string[];
1279 };
1280 observe: 'events';
1281 context?: HttpContext;
1282 params?: HttpParams | {
1283 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1284 };
1285 reportProgress?: boolean;
1286 responseType: 'blob';
1287 withCredentials?: boolean;
1288 }): Observable<HttpEvent<Blob>>;
1289 /**
1290 * Constructs a `HEAD` request that interprets the body as a text string
1291 * and returns the full event stream.
1292 *
1293 * @param url The endpoint URL.
1294 * @param options The HTTP options to send with the request.
1295 *
1296 * @return An `Observable` of all `HttpEvent`s for the request, with the response body of type
1297 * string.
1298 */
1299 head(url: string, options: {
1300 headers?: HttpHeaders | {
1301 [header: string]: string | string[];
1302 };
1303 observe: 'events';
1304 context?: HttpContext;
1305 params?: HttpParams | {
1306 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1307 };
1308 reportProgress?: boolean;
1309 responseType: 'text';
1310 withCredentials?: boolean;
1311 }): Observable<HttpEvent<string>>;
1312 /**
1313 * Constructs a `HEAD` request that interprets the body as a JSON object
1314 * and returns the full HTTP event stream.
1315 *
1316 * @param url The endpoint URL.
1317 * @param options The HTTP options to send with the request.
1318 *
1319 * @return An `Observable` of all `HttpEvent`s for the request, with a response body of
1320 * type `Object`.
1321 */
1322 head(url: string, options: {
1323 headers?: HttpHeaders | {
1324 [header: string]: string | string[];
1325 };
1326 observe: 'events';
1327 context?: HttpContext;
1328 params?: HttpParams | {
1329 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1330 };
1331 reportProgress?: boolean;
1332 responseType?: 'json';
1333 withCredentials?: boolean;
1334 }): Observable<HttpEvent<Object>>;
1335 /**
1336 * Constructs a `HEAD` request that interprets the body as a JSON object and
1337 * returns the full event stream.
1338 *
1339 * @return An `Observable` of all the `HttpEvent`s for the request,
1340 * with a response body in the requested type.
1341 *
1342 * @param url The endpoint URL.
1343 * @param options The HTTP options to send with the request.
1344 */
1345 head<T>(url: string, options: {
1346 headers?: HttpHeaders | {
1347 [header: string]: string | string[];
1348 };
1349 observe: 'events';
1350 context?: HttpContext;
1351 params?: HttpParams | {
1352 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1353 };
1354 reportProgress?: boolean;
1355 responseType?: 'json';
1356 withCredentials?: boolean;
1357 }): Observable<HttpEvent<T>>;
1358 /**
1359 * Constructs a `HEAD` request that interprets the body as an `ArrayBuffer`
1360 * and returns the full HTTP response.
1361 *
1362 * @param url The endpoint URL.
1363 * @param options The HTTP options to send with the request.
1364 *
1365 * @return An `Observable` of the `HttpResponse` for the request,
1366 * with the response body as an `ArrayBuffer`.
1367 */
1368 head(url: string, options: {
1369 headers?: HttpHeaders | {
1370 [header: string]: string | string[];
1371 };
1372 observe: 'response';
1373 context?: HttpContext;
1374 params?: HttpParams | {
1375 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1376 };
1377 reportProgress?: boolean;
1378 responseType: 'arraybuffer';
1379 withCredentials?: boolean;
1380 }): Observable<HttpResponse<ArrayBuffer>>;
1381 /**
1382 * Constructs a `HEAD` request that interprets the body as a `Blob` and returns
1383 * the full `HttpResponse`.
1384 *
1385 * @param url The endpoint URL.
1386 * @param options The HTTP options to send with the request.
1387 *
1388 * @return An `Observable` of the `HttpResponse` for the request,
1389 * with the response body as a blob.
1390 */
1391 head(url: string, options: {
1392 headers?: HttpHeaders | {
1393 [header: string]: string | string[];
1394 };
1395 observe: 'response';
1396 context?: HttpContext;
1397 params?: HttpParams | {
1398 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1399 };
1400 reportProgress?: boolean;
1401 responseType: 'blob';
1402 withCredentials?: boolean;
1403 }): Observable<HttpResponse<Blob>>;
1404 /**
1405 * Constructs a `HEAD` request that interprets the body as text stream
1406 * and returns the full `HttpResponse`.
1407 *
1408 * @param url The endpoint URL.
1409 * @param options The HTTP options to send with the request.
1410 *
1411 * @return An `Observable` of the `HttpResponse` for the request,
1412 * with the response body of type string.
1413 */
1414 head(url: string, options: {
1415 headers?: HttpHeaders | {
1416 [header: string]: string | string[];
1417 };
1418 observe: 'response';
1419 context?: HttpContext;
1420 params?: HttpParams | {
1421 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1422 };
1423 reportProgress?: boolean;
1424 responseType: 'text';
1425 withCredentials?: boolean;
1426 }): Observable<HttpResponse<string>>;
1427 /**
1428 * Constructs a `HEAD` request that interprets the body as a JSON object and
1429 * returns the full `HttpResponse`.
1430 *
1431 * @param url The endpoint URL.
1432 * @param options The HTTP options to send with the request.
1433 *
1434 * @return An `Observable` of the `HttpResponse` for the request,
1435 * with the response body of type `Object`.
1436 */
1437 head(url: string, options: {
1438 headers?: HttpHeaders | {
1439 [header: string]: string | string[];
1440 };
1441 observe: 'response';
1442 context?: HttpContext;
1443 params?: HttpParams | {
1444 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1445 };
1446 reportProgress?: boolean;
1447 responseType?: 'json';
1448 withCredentials?: boolean;
1449 }): Observable<HttpResponse<Object>>;
1450 /**
1451 * Constructs a `HEAD` request that interprets the body as a JSON object
1452 * and returns the full `HttpResponse`.
1453 *
1454 * @param url The endpoint URL.
1455 * @param options The HTTP options to send with the request.
1456 *
1457 * @return An `Observable` of the `HttpResponse` for the request,
1458 * with a response body of the requested type.
1459 */
1460 head<T>(url: string, options: {
1461 headers?: HttpHeaders | {
1462 [header: string]: string | string[];
1463 };
1464 observe: 'response';
1465 context?: HttpContext;
1466 params?: HttpParams | {
1467 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1468 };
1469 reportProgress?: boolean;
1470 responseType?: 'json';
1471 withCredentials?: boolean;
1472 }): Observable<HttpResponse<T>>;
1473 /**
1474 * Constructs a `HEAD` request that interprets the body as a JSON object and
1475 * returns the response body as a JSON object.
1476 *
1477 * @param url The endpoint URL.
1478 * @param options The HTTP options to send with the request.
1479 *
1480 * @return An `Observable` of the response, with the response body as a JSON object.
1481 */
1482 head(url: string, options?: {
1483 headers?: HttpHeaders | {
1484 [header: string]: string | string[];
1485 };
1486 context?: HttpContext;
1487 observe?: 'body';
1488 params?: HttpParams | {
1489 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1490 };
1491 reportProgress?: boolean;
1492 responseType?: 'json';
1493 withCredentials?: boolean;
1494 }): Observable<Object>;
1495 /**
1496 * Constructs a `HEAD` request that interprets the body as a JSON object and returns
1497 * the response in a given type.
1498 *
1499 * @param url The endpoint URL.
1500 * @param options The HTTP options to send with the request.
1501 *
1502 * @return An `Observable` of the `HttpResponse` for the request,
1503 * with a response body of the given type.
1504 */
1505 head<T>(url: string, options?: {
1506 headers?: HttpHeaders | {
1507 [header: string]: string | string[];
1508 };
1509 context?: HttpContext;
1510 observe?: 'body';
1511 params?: HttpParams | {
1512 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1513 };
1514 reportProgress?: boolean;
1515 responseType?: 'json';
1516 withCredentials?: boolean;
1517 }): Observable<T>;
1518 /**
1519 * Constructs a `JSONP` request for the given URL and name of the callback parameter.
1520 *
1521 * @param url The resource URL.
1522 * @param callbackParam The callback function name.
1523 *
1524 * @return An `Observable` of the response object, with response body as an object.
1525 */
1526 jsonp(url: string, callbackParam: string): Observable<Object>;
1527 /**
1528 * Constructs a `JSONP` request for the given URL and name of the callback parameter.
1529 *
1530 * @param url The resource URL.
1531 * @param callbackParam The callback function name.
1532 *
1533 * You must install a suitable interceptor, such as one provided by `HttpClientJsonpModule`.
1534 * If no such interceptor is reached,
1535 * then the `JSONP` request can be rejected by the configured backend.
1536 *
1537 * @return An `Observable` of the response object, with response body in the requested type.
1538 */
1539 jsonp<T>(url: string, callbackParam: string): Observable<T>;
1540 /**
1541 * Constructs an `OPTIONS` request that interprets the body as an
1542 * `ArrayBuffer` and returns the response as an `ArrayBuffer`.
1543 *
1544 * @param url The endpoint URL.
1545 * @param options HTTP options.
1546 *
1547 * @return An `Observable` of the response, with the response body as an `ArrayBuffer`.
1548 */
1549 options(url: string, options: {
1550 headers?: HttpHeaders | {
1551 [header: string]: string | string[];
1552 };
1553 context?: HttpContext;
1554 observe?: 'body';
1555 params?: HttpParams | {
1556 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1557 };
1558 reportProgress?: boolean;
1559 responseType: 'arraybuffer';
1560 withCredentials?: boolean;
1561 }): Observable<ArrayBuffer>;
1562 /**
1563 * Constructs an `OPTIONS` request that interprets the body as a `Blob` and returns
1564 * the response as a `Blob`.
1565 *
1566 * @param url The endpoint URL.
1567 * @param options HTTP options.
1568 *
1569 * @return An `Observable` of the response, with the response body as a `Blob`.
1570 */
1571 options(url: string, options: {
1572 headers?: HttpHeaders | {
1573 [header: string]: string | string[];
1574 };
1575 context?: HttpContext;
1576 observe?: 'body';
1577 params?: HttpParams | {
1578 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1579 };
1580 reportProgress?: boolean;
1581 responseType: 'blob';
1582 withCredentials?: boolean;
1583 }): Observable<Blob>;
1584 /**
1585 * Constructs an `OPTIONS` request that interprets the body as a text string and
1586 * returns a string value.
1587 *
1588 * @param url The endpoint URL.
1589 * @param options HTTP options.
1590 *
1591 * @return An `Observable` of the response, with the response body of type string.
1592 */
1593 options(url: string, options: {
1594 headers?: HttpHeaders | {
1595 [header: string]: string | string[];
1596 };
1597 context?: HttpContext;
1598 observe?: 'body';
1599 params?: HttpParams | {
1600 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1601 };
1602 reportProgress?: boolean;
1603 responseType: 'text';
1604 withCredentials?: boolean;
1605 }): Observable<string>;
1606 /**
1607 * Constructs an `OPTIONS` request that interprets the body as an `ArrayBuffer`
1608 * and returns the full event stream.
1609 *
1610 * @param url The endpoint URL.
1611 * @param options HTTP options.
1612 *
1613 * @return An `Observable` of all `HttpEvent`s for the request,
1614 * with the response body as an `ArrayBuffer`.
1615 */
1616 options(url: string, options: {
1617 headers?: HttpHeaders | {
1618 [header: string]: string | string[];
1619 };
1620 observe: 'events';
1621 context?: HttpContext;
1622 params?: HttpParams | {
1623 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1624 };
1625 reportProgress?: boolean;
1626 responseType: 'arraybuffer';
1627 withCredentials?: boolean;
1628 }): Observable<HttpEvent<ArrayBuffer>>;
1629 /**
1630 * Constructs an `OPTIONS` request that interprets the body as a `Blob` and
1631 * returns the full event stream.
1632 *
1633 * @param url The endpoint URL.
1634 * @param options HTTP options.
1635 *
1636 * @return An `Observable` of all `HttpEvent`s for the request,
1637 * with the response body as a `Blob`.
1638 */
1639 options(url: string, options: {
1640 headers?: HttpHeaders | {
1641 [header: string]: string | string[];
1642 };
1643 observe: 'events';
1644 context?: HttpContext;
1645 params?: HttpParams | {
1646 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1647 };
1648 reportProgress?: boolean;
1649 responseType: 'blob';
1650 withCredentials?: boolean;
1651 }): Observable<HttpEvent<Blob>>;
1652 /**
1653 * Constructs an `OPTIONS` request that interprets the body as a text string
1654 * and returns the full event stream.
1655 *
1656 * @param url The endpoint URL.
1657 * @param options HTTP options.
1658 *
1659 * @return An `Observable` of all the `HttpEvent`s for the request,
1660 * with the response body of type string.
1661 */
1662 options(url: string, options: {
1663 headers?: HttpHeaders | {
1664 [header: string]: string | string[];
1665 };
1666 observe: 'events';
1667 context?: HttpContext;
1668 params?: HttpParams | {
1669 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1670 };
1671 reportProgress?: boolean;
1672 responseType: 'text';
1673 withCredentials?: boolean;
1674 }): Observable<HttpEvent<string>>;
1675 /**
1676 * Constructs an `OPTIONS` request that interprets the body as a JSON object
1677 * and returns the full event stream.
1678 *
1679 * @param url The endpoint URL.
1680 * @param options HTTP options.
1681 *
1682 * @return An `Observable` of all the `HttpEvent`s for the request with the response
1683 * body of type `Object`.
1684 */
1685 options(url: string, options: {
1686 headers?: HttpHeaders | {
1687 [header: string]: string | string[];
1688 };
1689 observe: 'events';
1690 context?: HttpContext;
1691 params?: HttpParams | {
1692 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1693 };
1694 reportProgress?: boolean;
1695 responseType?: 'json';
1696 withCredentials?: boolean;
1697 }): Observable<HttpEvent<Object>>;
1698 /**
1699 * Constructs an `OPTIONS` request that interprets the body as a JSON object and
1700 * returns the full event stream.
1701 *
1702 * @param url The endpoint URL.
1703 * @param options HTTP options.
1704 *
1705 * @return An `Observable` of all the `HttpEvent`s for the request,
1706 * with a response body in the requested type.
1707 */
1708 options<T>(url: string, options: {
1709 headers?: HttpHeaders | {
1710 [header: string]: string | string[];
1711 };
1712 observe: 'events';
1713 context?: HttpContext;
1714 params?: HttpParams | {
1715 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1716 };
1717 reportProgress?: boolean;
1718 responseType?: 'json';
1719 withCredentials?: boolean;
1720 }): Observable<HttpEvent<T>>;
1721 /**
1722 * Constructs an `OPTIONS` request that interprets the body as an `ArrayBuffer`
1723 * and returns the full HTTP response.
1724 *
1725 * @param url The endpoint URL.
1726 * @param options HTTP options.
1727 *
1728 * @return An `Observable` of the `HttpResponse` for the request,
1729 * with the response body as an `ArrayBuffer`.
1730 */
1731 options(url: string, options: {
1732 headers?: HttpHeaders | {
1733 [header: string]: string | string[];
1734 };
1735 observe: 'response';
1736 context?: HttpContext;
1737 params?: HttpParams | {
1738 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1739 };
1740 reportProgress?: boolean;
1741 responseType: 'arraybuffer';
1742 withCredentials?: boolean;
1743 }): Observable<HttpResponse<ArrayBuffer>>;
1744 /**
1745 * Constructs an `OPTIONS` request that interprets the body as a `Blob`
1746 * and returns the full `HttpResponse`.
1747 *
1748 * @param url The endpoint URL.
1749 * @param options HTTP options.
1750 *
1751 * @return An `Observable` of the `HttpResponse` for the request,
1752 * with the response body as a `Blob`.
1753 */
1754 options(url: string, options: {
1755 headers?: HttpHeaders | {
1756 [header: string]: string | string[];
1757 };
1758 observe: 'response';
1759 context?: HttpContext;
1760 params?: HttpParams | {
1761 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1762 };
1763 reportProgress?: boolean;
1764 responseType: 'blob';
1765 withCredentials?: boolean;
1766 }): Observable<HttpResponse<Blob>>;
1767 /**
1768 * Constructs an `OPTIONS` request that interprets the body as text stream
1769 * and returns the full `HttpResponse`.
1770 *
1771 * @param url The endpoint URL.
1772 * @param options HTTP options.
1773 *
1774 * @return An `Observable` of the `HttpResponse` for the request,
1775 * with the response body of type string.
1776 */
1777 options(url: string, options: {
1778 headers?: HttpHeaders | {
1779 [header: string]: string | string[];
1780 };
1781 observe: 'response';
1782 context?: HttpContext;
1783 params?: HttpParams | {
1784 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1785 };
1786 reportProgress?: boolean;
1787 responseType: 'text';
1788 withCredentials?: boolean;
1789 }): Observable<HttpResponse<string>>;
1790 /**
1791 * Constructs an `OPTIONS` request that interprets the body as a JSON object
1792 * and returns the full `HttpResponse`.
1793 *
1794 * @param url The endpoint URL.
1795 * @param options HTTP options.
1796 *
1797 * @return An `Observable` of the `HttpResponse` for the request,
1798 * with the response body of type `Object`.
1799 */
1800 options(url: string, options: {
1801 headers?: HttpHeaders | {
1802 [header: string]: string | string[];
1803 };
1804 observe: 'response';
1805 context?: HttpContext;
1806 params?: HttpParams | {
1807 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1808 };
1809 reportProgress?: boolean;
1810 responseType?: 'json';
1811 withCredentials?: boolean;
1812 }): Observable<HttpResponse<Object>>;
1813 /**
1814 * Constructs an `OPTIONS` request that interprets the body as a JSON object and
1815 * returns the full `HttpResponse`.
1816 *
1817 * @param url The endpoint URL.
1818 * @param options HTTP options.
1819 *
1820 * @return An `Observable` of the `HttpResponse` for the request,
1821 * with a response body in the requested type.
1822 */
1823 options<T>(url: string, options: {
1824 headers?: HttpHeaders | {
1825 [header: string]: string | string[];
1826 };
1827 observe: 'response';
1828 context?: HttpContext;
1829 params?: HttpParams | {
1830 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1831 };
1832 reportProgress?: boolean;
1833 responseType?: 'json';
1834 withCredentials?: boolean;
1835 }): Observable<HttpResponse<T>>;
1836 /**
1837 * Constructs an `OPTIONS` request that interprets the body as a JSON object and returns the
1838 * response body as a JSON object.
1839 *
1840 * @param url The endpoint URL.
1841 * @param options HTTP options.
1842 *
1843 * @return An `Observable` of the response, with the response body as a JSON object.
1844 */
1845 options(url: string, options?: {
1846 headers?: HttpHeaders | {
1847 [header: string]: string | string[];
1848 };
1849 context?: HttpContext;
1850 observe?: 'body';
1851 params?: HttpParams | {
1852 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1853 };
1854 reportProgress?: boolean;
1855 responseType?: 'json';
1856 withCredentials?: boolean;
1857 }): Observable<Object>;
1858 /**
1859 * Constructs an `OPTIONS` request that interprets the body as a JSON object and returns the
1860 * response in a given type.
1861 *
1862 * @param url The endpoint URL.
1863 * @param options HTTP options.
1864 *
1865 * @return An `Observable` of the `HttpResponse`, with a response body of the given type.
1866 */
1867 options<T>(url: string, options?: {
1868 headers?: HttpHeaders | {
1869 [header: string]: string | string[];
1870 };
1871 context?: HttpContext;
1872 observe?: 'body';
1873 params?: HttpParams | {
1874 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1875 };
1876 reportProgress?: boolean;
1877 responseType?: 'json';
1878 withCredentials?: boolean;
1879 }): Observable<T>;
1880 /**
1881 * Constructs a `PATCH` request that interprets the body as an `ArrayBuffer` and returns
1882 * the response as an `ArrayBuffer`.
1883 *
1884 * @param url The endpoint URL.
1885 * @param body The resources to edit.
1886 * @param options HTTP options.
1887 *
1888 * @return An `Observable` of the response, with the response body as an `ArrayBuffer`.
1889 */
1890 patch(url: string, body: any | null, options: {
1891 headers?: HttpHeaders | {
1892 [header: string]: string | string[];
1893 };
1894 context?: HttpContext;
1895 observe?: 'body';
1896 params?: HttpParams | {
1897 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1898 };
1899 reportProgress?: boolean;
1900 responseType: 'arraybuffer';
1901 withCredentials?: boolean;
1902 }): Observable<ArrayBuffer>;
1903 /**
1904 * Constructs a `PATCH` request that interprets the body as a `Blob` and returns the response
1905 * as a `Blob`.
1906 *
1907 * @param url The endpoint URL.
1908 * @param body The resources to edit.
1909 * @param options HTTP options.
1910 *
1911 * @return An `Observable` of the response, with the response body as a `Blob`.
1912 */
1913 patch(url: string, body: any | null, options: {
1914 headers?: HttpHeaders | {
1915 [header: string]: string | string[];
1916 };
1917 context?: HttpContext;
1918 observe?: 'body';
1919 params?: HttpParams | {
1920 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1921 };
1922 reportProgress?: boolean;
1923 responseType: 'blob';
1924 withCredentials?: boolean;
1925 }): Observable<Blob>;
1926 /**
1927 * Constructs a `PATCH` request that interprets the body as a text string and
1928 * returns the response as a string value.
1929 *
1930 * @param url The endpoint URL.
1931 * @param body The resources to edit.
1932 * @param options HTTP options.
1933 *
1934 * @return An `Observable` of the response, with a response body of type string.
1935 */
1936 patch(url: string, body: any | null, options: {
1937 headers?: HttpHeaders | {
1938 [header: string]: string | string[];
1939 };
1940 context?: HttpContext;
1941 observe?: 'body';
1942 params?: HttpParams | {
1943 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1944 };
1945 reportProgress?: boolean;
1946 responseType: 'text';
1947 withCredentials?: boolean;
1948 }): Observable<string>;
1949 /**
1950 * Constructs a `PATCH` request that interprets the body as an `ArrayBuffer` and
1951 * returns the full event stream.
1952 *
1953 * @param url The endpoint URL.
1954 * @param body The resources to edit.
1955 * @param options HTTP options.
1956 *
1957 * @return An `Observable` of all the `HttpEvent`s for the request,
1958 * with the response body as an `ArrayBuffer`.
1959 */
1960 patch(url: string, body: any | null, options: {
1961 headers?: HttpHeaders | {
1962 [header: string]: string | string[];
1963 };
1964 observe: 'events';
1965 context?: HttpContext;
1966 params?: HttpParams | {
1967 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1968 };
1969 reportProgress?: boolean;
1970 responseType: 'arraybuffer';
1971 withCredentials?: boolean;
1972 }): Observable<HttpEvent<ArrayBuffer>>;
1973 /**
1974 * Constructs a `PATCH` request that interprets the body as a `Blob`
1975 * and returns the full event stream.
1976 *
1977 * @param url The endpoint URL.
1978 * @param body The resources to edit.
1979 * @param options HTTP options.
1980 *
1981 * @return An `Observable` of all the `HttpEvent`s for the request, with the
1982 * response body as `Blob`.
1983 */
1984 patch(url: string, body: any | null, options: {
1985 headers?: HttpHeaders | {
1986 [header: string]: string | string[];
1987 };
1988 observe: 'events';
1989 context?: HttpContext;
1990 params?: HttpParams | {
1991 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
1992 };
1993 reportProgress?: boolean;
1994 responseType: 'blob';
1995 withCredentials?: boolean;
1996 }): Observable<HttpEvent<Blob>>;
1997 /**
1998 * Constructs a `PATCH` request that interprets the body as a text string and
1999 * returns the full event stream.
2000 *
2001 * @param url The endpoint URL.
2002 * @param body The resources to edit.
2003 * @param options HTTP options.
2004 *
2005 * @return An `Observable` of all the `HttpEvent`s for the request, with a
2006 * response body of type string.
2007 */
2008 patch(url: string, body: any | null, options: {
2009 headers?: HttpHeaders | {
2010 [header: string]: string | string[];
2011 };
2012 observe: 'events';
2013 context?: HttpContext;
2014 params?: HttpParams | {
2015 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2016 };
2017 reportProgress?: boolean;
2018 responseType: 'text';
2019 withCredentials?: boolean;
2020 }): Observable<HttpEvent<string>>;
2021 /**
2022 * Constructs a `PATCH` request that interprets the body as a JSON object
2023 * and returns the full event stream.
2024 *
2025 * @param url The endpoint URL.
2026 * @param body The resources to edit.
2027 * @param options HTTP options.
2028 *
2029 * @return An `Observable` of all the `HttpEvent`s for the request,
2030 * with a response body of type `Object`.
2031 */
2032 patch(url: string, body: any | null, options: {
2033 headers?: HttpHeaders | {
2034 [header: string]: string | string[];
2035 };
2036 observe: 'events';
2037 context?: HttpContext;
2038 params?: HttpParams | {
2039 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2040 };
2041 reportProgress?: boolean;
2042 responseType?: 'json';
2043 withCredentials?: boolean;
2044 }): Observable<HttpEvent<Object>>;
2045 /**
2046 * Constructs a `PATCH` request that interprets the body as a JSON object
2047 * and returns the full event stream.
2048 *
2049 * @param url The endpoint URL.
2050 * @param body The resources to edit.
2051 * @param options HTTP options.
2052 *
2053 * @return An `Observable` of all the `HttpEvent`s for the request,
2054 * with a response body in the requested type.
2055 */
2056 patch<T>(url: string, body: any | null, options: {
2057 headers?: HttpHeaders | {
2058 [header: string]: string | string[];
2059 };
2060 observe: 'events';
2061 context?: HttpContext;
2062 params?: HttpParams | {
2063 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2064 };
2065 reportProgress?: boolean;
2066 responseType?: 'json';
2067 withCredentials?: boolean;
2068 }): Observable<HttpEvent<T>>;
2069 /**
2070 * Constructs a `PATCH` request that interprets the body as an `ArrayBuffer`
2071 * and returns the full `HttpResponse`.
2072 *
2073 * @param url The endpoint URL.
2074 * @param body The resources to edit.
2075 * @param options HTTP options.
2076 *
2077 * @return An `Observable` of the `HttpResponse` for the request,
2078 * with the response body as an `ArrayBuffer`.
2079 */
2080 patch(url: string, body: any | null, options: {
2081 headers?: HttpHeaders | {
2082 [header: string]: string | string[];
2083 };
2084 observe: 'response';
2085 context?: HttpContext;
2086 params?: HttpParams | {
2087 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2088 };
2089 reportProgress?: boolean;
2090 responseType: 'arraybuffer';
2091 withCredentials?: boolean;
2092 }): Observable<HttpResponse<ArrayBuffer>>;
2093 /**
2094 * Constructs a `PATCH` request that interprets the body as a `Blob` and returns the full
2095 * `HttpResponse`.
2096 *
2097 * @param url The endpoint URL.
2098 * @param body The resources to edit.
2099 * @param options HTTP options.
2100 *
2101 * @return An `Observable` of the `HttpResponse` for the request,
2102 * with the response body as a `Blob`.
2103 */
2104 patch(url: string, body: any | null, options: {
2105 headers?: HttpHeaders | {
2106 [header: string]: string | string[];
2107 };
2108 observe: 'response';
2109 context?: HttpContext;
2110 params?: HttpParams | {
2111 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2112 };
2113 reportProgress?: boolean;
2114 responseType: 'blob';
2115 withCredentials?: boolean;
2116 }): Observable<HttpResponse<Blob>>;
2117 /**
2118 * Constructs a `PATCH` request that interprets the body as a text stream and returns the
2119 * full `HttpResponse`.
2120 *
2121 * @param url The endpoint URL.
2122 * @param body The resources to edit.
2123 * @param options HTTP options.
2124 *
2125 * @return An `Observable` of the `HttpResponse` for the request,
2126 * with a response body of type string.
2127 */
2128 patch(url: string, body: any | null, options: {
2129 headers?: HttpHeaders | {
2130 [header: string]: string | string[];
2131 };
2132 observe: 'response';
2133 context?: HttpContext;
2134 params?: HttpParams | {
2135 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2136 };
2137 reportProgress?: boolean;
2138 responseType: 'text';
2139 withCredentials?: boolean;
2140 }): Observable<HttpResponse<string>>;
2141 /**
2142 * Constructs a `PATCH` request that interprets the body as a JSON object
2143 * and returns the full `HttpResponse`.
2144 *
2145 * @param url The endpoint URL.
2146 * @param body The resources to edit.
2147 * @param options HTTP options.
2148 *
2149 * @return An `Observable` of the `HttpResponse` for the request,
2150 * with a response body in the requested type.
2151 */
2152 patch(url: string, body: any | null, options: {
2153 headers?: HttpHeaders | {
2154 [header: string]: string | string[];
2155 };
2156 observe: 'response';
2157 context?: HttpContext;
2158 params?: HttpParams | {
2159 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2160 };
2161 reportProgress?: boolean;
2162 responseType?: 'json';
2163 withCredentials?: boolean;
2164 }): Observable<HttpResponse<Object>>;
2165 /**
2166 * Constructs a `PATCH` request that interprets the body as a JSON object
2167 * and returns the full `HttpResponse`.
2168 *
2169 * @param url The endpoint URL.
2170 * @param body The resources to edit.
2171 * @param options HTTP options.
2172 *
2173 * @return An `Observable` of the `HttpResponse` for the request,
2174 * with a response body in the given type.
2175 */
2176 patch<T>(url: string, body: any | null, options: {
2177 headers?: HttpHeaders | {
2178 [header: string]: string | string[];
2179 };
2180 observe: 'response';
2181 context?: HttpContext;
2182 params?: HttpParams | {
2183 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2184 };
2185 reportProgress?: boolean;
2186 responseType?: 'json';
2187 withCredentials?: boolean;
2188 }): Observable<HttpResponse<T>>;
2189 /**
2190 * Constructs a `PATCH` request that interprets the body as a JSON object and
2191 * returns the response body as a JSON object.
2192 *
2193 * @param url The endpoint URL.
2194 * @param body The resources to edit.
2195 * @param options HTTP options.
2196 *
2197 * @return An `Observable` of the response, with the response body as a JSON object.
2198 */
2199 patch(url: string, body: any | null, options?: {
2200 headers?: HttpHeaders | {
2201 [header: string]: string | string[];
2202 };
2203 context?: HttpContext;
2204 observe?: 'body';
2205 params?: HttpParams | {
2206 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2207 };
2208 reportProgress?: boolean;
2209 responseType?: 'json';
2210 withCredentials?: boolean;
2211 }): Observable<Object>;
2212 /**
2213 * Constructs a `PATCH` request that interprets the body as a JSON object
2214 * and returns the response in a given type.
2215 *
2216 * @param url The endpoint URL.
2217 * @param body The resources to edit.
2218 * @param options HTTP options.
2219 *
2220 * @return An `Observable` of the `HttpResponse` for the request,
2221 * with a response body in the given type.
2222 */
2223 patch<T>(url: string, body: any | null, options?: {
2224 headers?: HttpHeaders | {
2225 [header: string]: string | string[];
2226 };
2227 context?: HttpContext;
2228 observe?: 'body';
2229 params?: HttpParams | {
2230 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2231 };
2232 reportProgress?: boolean;
2233 responseType?: 'json';
2234 withCredentials?: boolean;
2235 }): Observable<T>;
2236 /**
2237 * Constructs a `POST` request that interprets the body as an `ArrayBuffer` and returns
2238 * an `ArrayBuffer`.
2239 *
2240 * @param url The endpoint URL.
2241 * @param body The content to replace with.
2242 * @param options HTTP options.
2243 *
2244 * @return An `Observable` of the response, with the response body as an `ArrayBuffer`.
2245 */
2246 post(url: string, body: any | null, options: {
2247 headers?: HttpHeaders | {
2248 [header: string]: string | string[];
2249 };
2250 context?: HttpContext;
2251 observe?: 'body';
2252 params?: HttpParams | {
2253 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2254 };
2255 reportProgress?: boolean;
2256 responseType: 'arraybuffer';
2257 withCredentials?: boolean;
2258 }): Observable<ArrayBuffer>;
2259 /**
2260 * Constructs a `POST` request that interprets the body as a `Blob` and returns the
2261 * response as a `Blob`.
2262 *
2263 * @param url The endpoint URL.
2264 * @param body The content to replace with.
2265 * @param options HTTP options
2266 *
2267 * @return An `Observable` of the response, with the response body as a `Blob`.
2268 */
2269 post(url: string, body: any | null, options: {
2270 headers?: HttpHeaders | {
2271 [header: string]: string | string[];
2272 };
2273 context?: HttpContext;
2274 observe?: 'body';
2275 params?: HttpParams | {
2276 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2277 };
2278 reportProgress?: boolean;
2279 responseType: 'blob';
2280 withCredentials?: boolean;
2281 }): Observable<Blob>;
2282 /**
2283 * Constructs a `POST` request that interprets the body as a text string and
2284 * returns the response as a string value.
2285 *
2286 * @param url The endpoint URL.
2287 * @param body The content to replace with.
2288 * @param options HTTP options
2289 *
2290 * @return An `Observable` of the response, with a response body of type string.
2291 */
2292 post(url: string, body: any | null, options: {
2293 headers?: HttpHeaders | {
2294 [header: string]: string | string[];
2295 };
2296 context?: HttpContext;
2297 observe?: 'body';
2298 params?: HttpParams | {
2299 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2300 };
2301 reportProgress?: boolean;
2302 responseType: 'text';
2303 withCredentials?: boolean;
2304 }): Observable<string>;
2305 /**
2306 * Constructs a `POST` request that interprets the body as an `ArrayBuffer` and
2307 * returns the full event stream.
2308 *
2309 * @param url The endpoint URL.
2310 * @param body The content to replace with.
2311 * @param options HTTP options
2312 *
2313 * @return An `Observable` of all `HttpEvent`s for the request,
2314 * with the response body as an `ArrayBuffer`.
2315 */
2316 post(url: string, body: any | null, options: {
2317 headers?: HttpHeaders | {
2318 [header: string]: string | string[];
2319 };
2320 observe: 'events';
2321 context?: HttpContext;
2322 params?: HttpParams | {
2323 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2324 };
2325 reportProgress?: boolean;
2326 responseType: 'arraybuffer';
2327 withCredentials?: boolean;
2328 }): Observable<HttpEvent<ArrayBuffer>>;
2329 /**
2330 * Constructs a `POST` request that interprets the body as a `Blob`
2331 * and returns the response in an observable of the full event stream.
2332 *
2333 * @param url The endpoint URL.
2334 * @param body The content to replace with.
2335 * @param options HTTP options
2336 *
2337 * @return An `Observable` of all `HttpEvent`s for the request, with the response body as `Blob`.
2338 */
2339 post(url: string, body: any | null, options: {
2340 headers?: HttpHeaders | {
2341 [header: string]: string | string[];
2342 };
2343 observe: 'events';
2344 context?: HttpContext;
2345 params?: HttpParams | {
2346 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2347 };
2348 reportProgress?: boolean;
2349 responseType: 'blob';
2350 withCredentials?: boolean;
2351 }): Observable<HttpEvent<Blob>>;
2352 /**
2353 * Constructs a `POST` request that interprets the body as a text string and returns the full
2354 * event stream.
2355 *
2356 * @param url The endpoint URL.
2357 * @param body The content to replace with.
2358 * @param options HTTP options
2359 *
2360 * @return An `Observable` of all `HttpEvent`s for the request,
2361 * with a response body of type string.
2362 */
2363 post(url: string, body: any | null, options: {
2364 headers?: HttpHeaders | {
2365 [header: string]: string | string[];
2366 };
2367 observe: 'events';
2368 context?: HttpContext;
2369 params?: HttpParams | {
2370 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2371 };
2372 reportProgress?: boolean;
2373 responseType: 'text';
2374 withCredentials?: boolean;
2375 }): Observable<HttpEvent<string>>;
2376 /**
2377 * Constructs a POST request that interprets the body as a JSON object and returns the full event
2378 * stream.
2379 *
2380 * @param url The endpoint URL.
2381 * @param body The content to replace with.
2382 * @param options HTTP options
2383 *
2384 * @return An `Observable` of all `HttpEvent`s for the request,
2385 * with a response body of type `Object`.
2386 */
2387 post(url: string, body: any | null, options: {
2388 headers?: HttpHeaders | {
2389 [header: string]: string | string[];
2390 };
2391 observe: 'events';
2392 context?: HttpContext;
2393 params?: HttpParams | {
2394 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2395 };
2396 reportProgress?: boolean;
2397 responseType?: 'json';
2398 withCredentials?: boolean;
2399 }): Observable<HttpEvent<Object>>;
2400 /**
2401 * Constructs a POST request that interprets the body as a JSON object and returns the full event
2402 * stream.
2403 *
2404 * @param url The endpoint URL.
2405 * @param body The content to replace with.
2406 * @param options HTTP options
2407 *
2408 * @return An `Observable` of all `HttpEvent`s for the request,
2409 * with a response body in the requested type.
2410 */
2411 post<T>(url: string, body: any | null, options: {
2412 headers?: HttpHeaders | {
2413 [header: string]: string | string[];
2414 };
2415 observe: 'events';
2416 context?: HttpContext;
2417 params?: HttpParams | {
2418 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2419 };
2420 reportProgress?: boolean;
2421 responseType?: 'json';
2422 withCredentials?: boolean;
2423 }): Observable<HttpEvent<T>>;
2424 /**
2425 * Constructs a POST request that interprets the body as an `ArrayBuffer`
2426 * and returns the full `HttpResponse`.
2427 *
2428 * @param url The endpoint URL.
2429 * @param body The content to replace with.
2430 * @param options HTTP options
2431 *
2432 * @return An `Observable` of the `HttpResponse` for the request, with the response body as an
2433 * `ArrayBuffer`.
2434 */
2435 post(url: string, body: any | null, options: {
2436 headers?: HttpHeaders | {
2437 [header: string]: string | string[];
2438 };
2439 observe: 'response';
2440 context?: HttpContext;
2441 params?: HttpParams | {
2442 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2443 };
2444 reportProgress?: boolean;
2445 responseType: 'arraybuffer';
2446 withCredentials?: boolean;
2447 }): Observable<HttpResponse<ArrayBuffer>>;
2448 /**
2449 * Constructs a `POST` request that interprets the body as a `Blob` and returns the full
2450 * `HttpResponse`.
2451 *
2452 * @param url The endpoint URL.
2453 * @param body The content to replace with.
2454 * @param options HTTP options
2455 *
2456 * @return An `Observable` of the `HttpResponse` for the request,
2457 * with the response body as a `Blob`.
2458 */
2459 post(url: string, body: any | null, options: {
2460 headers?: HttpHeaders | {
2461 [header: string]: string | string[];
2462 };
2463 observe: 'response';
2464 context?: HttpContext;
2465 params?: HttpParams | {
2466 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2467 };
2468 reportProgress?: boolean;
2469 responseType: 'blob';
2470 withCredentials?: boolean;
2471 }): Observable<HttpResponse<Blob>>;
2472 /**
2473 * Constructs a `POST` request that interprets the body as a text stream and returns
2474 * the full `HttpResponse`.
2475 *
2476 * @param url The endpoint URL.
2477 * @param body The content to replace with.
2478 * @param options HTTP options
2479 *
2480 * @return An `Observable` of the `HttpResponse` for the request,
2481 * with a response body of type string.
2482 */
2483 post(url: string, body: any | null, options: {
2484 headers?: HttpHeaders | {
2485 [header: string]: string | string[];
2486 };
2487 observe: 'response';
2488 context?: HttpContext;
2489 params?: HttpParams | {
2490 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2491 };
2492 reportProgress?: boolean;
2493 responseType: 'text';
2494 withCredentials?: boolean;
2495 }): Observable<HttpResponse<string>>;
2496 /**
2497 * Constructs a `POST` request that interprets the body as a JSON object
2498 * and returns the full `HttpResponse`.
2499 *
2500 * @param url The endpoint URL.
2501 * @param body The content to replace with.
2502 * @param options HTTP options
2503 *
2504 * @return An `Observable` of the `HttpResponse` for the request, with a response body of type
2505 * `Object`.
2506 */
2507 post(url: string, body: any | null, options: {
2508 headers?: HttpHeaders | {
2509 [header: string]: string | string[];
2510 };
2511 observe: 'response';
2512 context?: HttpContext;
2513 params?: HttpParams | {
2514 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2515 };
2516 reportProgress?: boolean;
2517 responseType?: 'json';
2518 withCredentials?: boolean;
2519 }): Observable<HttpResponse<Object>>;
2520 /**
2521 * Constructs a `POST` request that interprets the body as a JSON object and returns the full
2522 * `HttpResponse`.
2523 *
2524 *
2525 * @param url The endpoint URL.
2526 * @param body The content to replace with.
2527 * @param options HTTP options
2528 *
2529 * @return An `Observable` of the `HttpResponse` for the request, with a response body in the
2530 * requested type.
2531 */
2532 post<T>(url: string, body: any | null, options: {
2533 headers?: HttpHeaders | {
2534 [header: string]: string | string[];
2535 };
2536 observe: 'response';
2537 context?: HttpContext;
2538 params?: HttpParams | {
2539 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2540 };
2541 reportProgress?: boolean;
2542 responseType?: 'json';
2543 withCredentials?: boolean;
2544 }): Observable<HttpResponse<T>>;
2545 /**
2546 * Constructs a `POST` request that interprets the body as a
2547 * JSON object and returns the response body as a JSON object.
2548 *
2549 * @param url The endpoint URL.
2550 * @param body The content to replace with.
2551 * @param options HTTP options
2552 *
2553 * @return An `Observable` of the response, with the response body as a JSON object.
2554 */
2555 post(url: string, body: any | null, options?: {
2556 headers?: HttpHeaders | {
2557 [header: string]: string | string[];
2558 };
2559 context?: HttpContext;
2560 observe?: 'body';
2561 params?: HttpParams | {
2562 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2563 };
2564 reportProgress?: boolean;
2565 responseType?: 'json';
2566 withCredentials?: boolean;
2567 }): Observable<Object>;
2568 /**
2569 * Constructs a `POST` request that interprets the body as a JSON object
2570 * and returns an observable of the response.
2571 *
2572 * @param url The endpoint URL.
2573 * @param body The content to replace with.
2574 * @param options HTTP options
2575 *
2576 * @return An `Observable` of the `HttpResponse` for the request, with a response body in the
2577 * requested type.
2578 */
2579 post<T>(url: string, body: any | null, options?: {
2580 headers?: HttpHeaders | {
2581 [header: string]: string | string[];
2582 };
2583 context?: HttpContext;
2584 observe?: 'body';
2585 params?: HttpParams | {
2586 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2587 };
2588 reportProgress?: boolean;
2589 responseType?: 'json';
2590 withCredentials?: boolean;
2591 }): Observable<T>;
2592 /**
2593 * Constructs a `PUT` request that interprets the body as an `ArrayBuffer` and returns the
2594 * response as an `ArrayBuffer`.
2595 *
2596 * @param url The endpoint URL.
2597 * @param body The resources to add/update.
2598 * @param options HTTP options
2599 *
2600 * @return An `Observable` of the response, with the response body as an `ArrayBuffer`.
2601 */
2602 put(url: string, body: any | null, options: {
2603 headers?: HttpHeaders | {
2604 [header: string]: string | string[];
2605 };
2606 context?: HttpContext;
2607 observe?: 'body';
2608 params?: HttpParams | {
2609 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2610 };
2611 reportProgress?: boolean;
2612 responseType: 'arraybuffer';
2613 withCredentials?: boolean;
2614 }): Observable<ArrayBuffer>;
2615 /**
2616 * Constructs a `PUT` request that interprets the body as a `Blob` and returns
2617 * the response as a `Blob`.
2618 *
2619 * @param url The endpoint URL.
2620 * @param body The resources to add/update.
2621 * @param options HTTP options
2622 *
2623 * @return An `Observable` of the response, with the response body as a `Blob`.
2624 */
2625 put(url: string, body: any | null, options: {
2626 headers?: HttpHeaders | {
2627 [header: string]: string | string[];
2628 };
2629 context?: HttpContext;
2630 observe?: 'body';
2631 params?: HttpParams | {
2632 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2633 };
2634 reportProgress?: boolean;
2635 responseType: 'blob';
2636 withCredentials?: boolean;
2637 }): Observable<Blob>;
2638 /**
2639 * Constructs a `PUT` request that interprets the body as a text string and
2640 * returns the response as a string value.
2641 *
2642 * @param url The endpoint URL.
2643 * @param body The resources to add/update.
2644 * @param options HTTP options
2645 *
2646 * @return An `Observable` of the response, with a response body of type string.
2647 */
2648 put(url: string, body: any | null, options: {
2649 headers?: HttpHeaders | {
2650 [header: string]: string | string[];
2651 };
2652 context?: HttpContext;
2653 observe?: 'body';
2654 params?: HttpParams | {
2655 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2656 };
2657 reportProgress?: boolean;
2658 responseType: 'text';
2659 withCredentials?: boolean;
2660 }): Observable<string>;
2661 /**
2662 * Constructs a `PUT` request that interprets the body as an `ArrayBuffer` and
2663 * returns the full event stream.
2664 *
2665 * @param url The endpoint URL.
2666 * @param body The resources to add/update.
2667 * @param options HTTP options
2668 *
2669 * @return An `Observable` of all `HttpEvent`s for the request,
2670 * with the response body as an `ArrayBuffer`.
2671 */
2672 put(url: string, body: any | null, options: {
2673 headers?: HttpHeaders | {
2674 [header: string]: string | string[];
2675 };
2676 observe: 'events';
2677 context?: HttpContext;
2678 params?: HttpParams | {
2679 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2680 };
2681 reportProgress?: boolean;
2682 responseType: 'arraybuffer';
2683 withCredentials?: boolean;
2684 }): Observable<HttpEvent<ArrayBuffer>>;
2685 /**
2686 * Constructs a `PUT` request that interprets the body as a `Blob` and returns the full event
2687 * stream.
2688 *
2689 * @param url The endpoint URL.
2690 * @param body The resources to add/update.
2691 * @param options HTTP options
2692 *
2693 * @return An `Observable` of all `HttpEvent`s for the request,
2694 * with the response body as a `Blob`.
2695 */
2696 put(url: string, body: any | null, options: {
2697 headers?: HttpHeaders | {
2698 [header: string]: string | string[];
2699 };
2700 observe: 'events';
2701 context?: HttpContext;
2702 params?: HttpParams | {
2703 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2704 };
2705 reportProgress?: boolean;
2706 responseType: 'blob';
2707 withCredentials?: boolean;
2708 }): Observable<HttpEvent<Blob>>;
2709 /**
2710 * Constructs a `PUT` request that interprets the body as a text string and returns the full event
2711 * stream.
2712 *
2713 * @param url The endpoint URL.
2714 * @param body The resources to add/update.
2715 * @param options HTTP options
2716 *
2717 * @return An `Observable` of all `HttpEvent`s for the request, with a response body
2718 * of type string.
2719 */
2720 put(url: string, body: any | null, options: {
2721 headers?: HttpHeaders | {
2722 [header: string]: string | string[];
2723 };
2724 observe: 'events';
2725 context?: HttpContext;
2726 params?: HttpParams | {
2727 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2728 };
2729 reportProgress?: boolean;
2730 responseType: 'text';
2731 withCredentials?: boolean;
2732 }): Observable<HttpEvent<string>>;
2733 /**
2734 * Constructs a `PUT` request that interprets the body as a JSON object and returns the full event
2735 * stream.
2736 *
2737 * @param url The endpoint URL.
2738 * @param body The resources to add/update.
2739 * @param options HTTP options
2740 *
2741 * @return An `Observable` of all `HttpEvent`s for the request, with a response body of
2742 * type `Object`.
2743 */
2744 put(url: string, body: any | null, options: {
2745 headers?: HttpHeaders | {
2746 [header: string]: string | string[];
2747 };
2748 observe: 'events';
2749 context?: HttpContext;
2750 params?: HttpParams | {
2751 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2752 };
2753 reportProgress?: boolean;
2754 responseType?: 'json';
2755 withCredentials?: boolean;
2756 }): Observable<HttpEvent<Object>>;
2757 /**
2758 * Constructs a `PUT` request that interprets the body as a JSON object and returns the
2759 * full event stream.
2760 *
2761 * @param url The endpoint URL.
2762 * @param body The resources to add/update.
2763 * @param options HTTP options
2764 *
2765 * @return An `Observable` of all `HttpEvent`s for the request,
2766 * with a response body in the requested type.
2767 */
2768 put<T>(url: string, body: any | null, options: {
2769 headers?: HttpHeaders | {
2770 [header: string]: string | string[];
2771 };
2772 observe: 'events';
2773 context?: HttpContext;
2774 params?: HttpParams | {
2775 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2776 };
2777 reportProgress?: boolean;
2778 responseType?: 'json';
2779 withCredentials?: boolean;
2780 }): Observable<HttpEvent<T>>;
2781 /**
2782 * Constructs a `PUT` request that interprets the body as an
2783 * `ArrayBuffer` and returns an observable of the full HTTP response.
2784 *
2785 * @param url The endpoint URL.
2786 * @param body The resources to add/update.
2787 * @param options HTTP options
2788 *
2789 * @return An `Observable` of the `HttpResponse` for the request, with the response body as an
2790 * `ArrayBuffer`.
2791 */
2792 put(url: string, body: any | null, options: {
2793 headers?: HttpHeaders | {
2794 [header: string]: string | string[];
2795 };
2796 observe: 'response';
2797 context?: HttpContext;
2798 params?: HttpParams | {
2799 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2800 };
2801 reportProgress?: boolean;
2802 responseType: 'arraybuffer';
2803 withCredentials?: boolean;
2804 }): Observable<HttpResponse<ArrayBuffer>>;
2805 /**
2806 * Constructs a `PUT` request that interprets the body as a `Blob` and returns the
2807 * full HTTP response.
2808 *
2809 * @param url The endpoint URL.
2810 * @param body The resources to add/update.
2811 * @param options HTTP options
2812 *
2813 * @return An `Observable` of the `HttpResponse` for the request,
2814 * with the response body as a `Blob`.
2815 */
2816 put(url: string, body: any | null, options: {
2817 headers?: HttpHeaders | {
2818 [header: string]: string | string[];
2819 };
2820 observe: 'response';
2821 context?: HttpContext;
2822 params?: HttpParams | {
2823 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2824 };
2825 reportProgress?: boolean;
2826 responseType: 'blob';
2827 withCredentials?: boolean;
2828 }): Observable<HttpResponse<Blob>>;
2829 /**
2830 * Constructs a `PUT` request that interprets the body as a text stream and returns the
2831 * full HTTP response.
2832 *
2833 * @param url The endpoint URL.
2834 * @param body The resources to add/update.
2835 * @param options HTTP options
2836 *
2837 * @return An `Observable` of the `HttpResponse` for the request, with a response body of type
2838 * string.
2839 */
2840 put(url: string, body: any | null, options: {
2841 headers?: HttpHeaders | {
2842 [header: string]: string | string[];
2843 };
2844 observe: 'response';
2845 context?: HttpContext;
2846 params?: HttpParams | {
2847 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2848 };
2849 reportProgress?: boolean;
2850 responseType: 'text';
2851 withCredentials?: boolean;
2852 }): Observable<HttpResponse<string>>;
2853 /**
2854 * Constructs a `PUT` request that interprets the body as a JSON object and returns the full HTTP
2855 * response.
2856 *
2857 * @param url The endpoint URL.
2858 * @param body The resources to add/update.
2859 * @param options HTTP options
2860 *
2861 * @return An `Observable` of the `HttpResponse` for the request, with a response body
2862 * of type 'Object`.
2863 */
2864 put(url: string, body: any | null, options: {
2865 headers?: HttpHeaders | {
2866 [header: string]: string | string[];
2867 };
2868 observe: 'response';
2869 context?: HttpContext;
2870 params?: HttpParams | {
2871 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2872 };
2873 reportProgress?: boolean;
2874 responseType?: 'json';
2875 withCredentials?: boolean;
2876 }): Observable<HttpResponse<Object>>;
2877 /**
2878 * Constructs a `PUT` request that interprets the body as an instance of the requested type and
2879 * returns the full HTTP response.
2880 *
2881 * @param url The endpoint URL.
2882 * @param body The resources to add/update.
2883 * @param options HTTP options
2884 *
2885 * @return An `Observable` of the `HttpResponse` for the request,
2886 * with a response body in the requested type.
2887 */
2888 put<T>(url: string, body: any | null, options: {
2889 headers?: HttpHeaders | {
2890 [header: string]: string | string[];
2891 };
2892 observe: 'response';
2893 context?: HttpContext;
2894 params?: HttpParams | {
2895 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2896 };
2897 reportProgress?: boolean;
2898 responseType?: 'json';
2899 withCredentials?: boolean;
2900 }): Observable<HttpResponse<T>>;
2901 /**
2902 * Constructs a `PUT` request that interprets the body as a JSON object
2903 * and returns an observable of JSON object.
2904 *
2905 * @param url The endpoint URL.
2906 * @param body The resources to add/update.
2907 * @param options HTTP options
2908 *
2909 * @return An `Observable` of the response as a JSON object.
2910 */
2911 put(url: string, body: any | null, options?: {
2912 headers?: HttpHeaders | {
2913 [header: string]: string | string[];
2914 };
2915 context?: HttpContext;
2916 observe?: 'body';
2917 params?: HttpParams | {
2918 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2919 };
2920 reportProgress?: boolean;
2921 responseType?: 'json';
2922 withCredentials?: boolean;
2923 }): Observable<Object>;
2924 /**
2925 * Constructs a `PUT` request that interprets the body as an instance of the requested type
2926 * and returns an observable of the requested type.
2927 *
2928 * @param url The endpoint URL.
2929 * @param body The resources to add/update.
2930 * @param options HTTP options
2931 *
2932 * @return An `Observable` of the requested type.
2933 */
2934 put<T>(url: string, body: any | null, options?: {
2935 headers?: HttpHeaders | {
2936 [header: string]: string | string[];
2937 };
2938 context?: HttpContext;
2939 observe?: 'body';
2940 params?: HttpParams | {
2941 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
2942 };
2943 reportProgress?: boolean;
2944 responseType?: 'json';
2945 withCredentials?: boolean;
2946 }): Observable<T>;
2947 static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<HttpClient, never>;
2948 static ɵprov: ɵngcc0.ɵɵInjectableDeclaration<HttpClient>;
2949}
2950
2951/**
2952 * Configures the [dependency injector](guide/glossary#injector) for `HttpClient`
2953 * with supporting services for JSONP.
2954 * Without this module, Jsonp requests reach the backend
2955 * with method JSONP, where they are rejected.
2956 *
2957 * You can add interceptors to the chain behind `HttpClient` by binding them to the
2958 * multiprovider for built-in [DI token](guide/glossary#di-token) `HTTP_INTERCEPTORS`.
2959 *
2960 * @publicApi
2961 */
2962export declare class HttpClientJsonpModule {
2963 static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<HttpClientJsonpModule, never>;
2964 static ɵmod: ɵngcc0.ɵɵNgModuleDeclaration<HttpClientJsonpModule, never, never, never>;
2965 static ɵinj: ɵngcc0.ɵɵInjectorDeclaration<HttpClientJsonpModule>;
2966}
2967
2968/**
2969 * Configures the [dependency injector](guide/glossary#injector) for `HttpClient`
2970 * with supporting services for XSRF. Automatically imported by `HttpClientModule`.
2971 *
2972 * You can add interceptors to the chain behind `HttpClient` by binding them to the
2973 * multiprovider for built-in [DI token](guide/glossary#di-token) `HTTP_INTERCEPTORS`.
2974 *
2975 * @publicApi
2976 */
2977export declare class HttpClientModule {
2978 static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<HttpClientModule, never>;
2979 static ɵmod: ɵngcc0.ɵɵNgModuleDeclaration<HttpClientModule, never, [typeof HttpClientXsrfModule], never>;
2980 static ɵinj: ɵngcc0.ɵɵInjectorDeclaration<HttpClientModule>;
2981}
2982
2983/**
2984 * Configures XSRF protection support for outgoing requests.
2985 *
2986 * For a server that supports a cookie-based XSRF protection system,
2987 * use directly to configure XSRF protection with the correct
2988 * cookie and header names.
2989 *
2990 * If no names are supplied, the default cookie name is `XSRF-TOKEN`
2991 * and the default header name is `X-XSRF-TOKEN`.
2992 *
2993 * @publicApi
2994 */
2995export declare class HttpClientXsrfModule {
2996 /**
2997 * Disable the default XSRF protection.
2998 */
2999 static disable(): ModuleWithProviders<HttpClientXsrfModule>;
3000 /**
3001 * Configure XSRF protection.
3002 * @param options An object that can specify either or both
3003 * cookie name or header name.
3004 * - Cookie name default is `XSRF-TOKEN`.
3005 * - Header name default is `X-XSRF-TOKEN`.
3006 *
3007 */
3008 static withOptions(options?: {
3009 cookieName?: string;
3010 headerName?: string;
3011 }): ModuleWithProviders<HttpClientXsrfModule>;
3012 static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<HttpClientXsrfModule, never>;
3013 static ɵmod: ɵngcc0.ɵɵNgModuleDeclaration<HttpClientXsrfModule, never, never, never>;
3014 static ɵinj: ɵngcc0.ɵɵInjectorDeclaration<HttpClientXsrfModule>;
3015}
3016
3017/**
3018 * Http context stores arbitrary user defined values and ensures type safety without
3019 * actually knowing the types. It is backed by a `Map` and guarantees that keys do not clash.
3020 *
3021 * This context is mutable and is shared between cloned requests unless explicitly specified.
3022 *
3023 * @usageNotes
3024 *
3025 * ### Usage Example
3026 *
3027 * ```typescript
3028 * // inside cache.interceptors.ts
3029 * export const IS_CACHE_ENABLED = new HttpContextToken<boolean>(() => false);
3030 *
3031 * export class CacheInterceptor implements HttpInterceptor {
3032 *
3033 * intercept(req: HttpRequest<any>, delegate: HttpHandler): Observable<HttpEvent<any>> {
3034 * if (req.context.get(IS_CACHE_ENABLED) === true) {
3035 * return ...;
3036 * }
3037 * return delegate.handle(req);
3038 * }
3039 * }
3040 *
3041 * // inside a service
3042 *
3043 * this.httpClient.get('/api/weather', {
3044 * context: new HttpContext().set(IS_CACHE_ENABLED, true)
3045 * }).subscribe(...);
3046 * ```
3047 *
3048 * @publicApi
3049 */
3050export declare class HttpContext {
3051 private readonly map;
3052 /**
3053 * Store a value in the context. If a value is already present it will be overwritten.
3054 *
3055 * @param token The reference to an instance of `HttpContextToken`.
3056 * @param value The value to store.
3057 *
3058 * @returns A reference to itself for easy chaining.
3059 */
3060 set<T>(token: HttpContextToken<T>, value: T): HttpContext;
3061 /**
3062 * Retrieve the value associated with the given token.
3063 *
3064 * @param token The reference to an instance of `HttpContextToken`.
3065 *
3066 * @returns The stored value or default if one is defined.
3067 */
3068 get<T>(token: HttpContextToken<T>): T;
3069 /**
3070 * Delete the value associated with the given token.
3071 *
3072 * @param token The reference to an instance of `HttpContextToken`.
3073 *
3074 * @returns A reference to itself for easy chaining.
3075 */
3076 delete(token: HttpContextToken<unknown>): HttpContext;
3077 /**
3078 * @returns a list of tokens currently stored in the context.
3079 */
3080 keys(): IterableIterator<HttpContextToken<unknown>>;
3081}
3082
3083
3084/**
3085 * A token used to manipulate and access values stored in `HttpContext`.
3086 *
3087 * @publicApi
3088 */
3089export declare class HttpContextToken<T> {
3090 readonly defaultValue: () => T;
3091 constructor(defaultValue: () => T);
3092}
3093
3094/**
3095 * A download progress event.
3096 *
3097 * @publicApi
3098 */
3099export declare interface HttpDownloadProgressEvent extends HttpProgressEvent {
3100 type: HttpEventType.DownloadProgress;
3101 /**
3102 * The partial response body as downloaded so far.
3103 *
3104 * Only present if the responseType was `text`.
3105 */
3106 partialText?: string;
3107}
3108
3109/**
3110 * A response that represents an error or failure, either from a
3111 * non-successful HTTP status, an error while executing the request,
3112 * or some other failure which occurred during the parsing of the response.
3113 *
3114 * Any error returned on the `Observable` response stream will be
3115 * wrapped in an `HttpErrorResponse` to provide additional context about
3116 * the state of the HTTP layer when the error occurred. The error property
3117 * will contain either a wrapped Error object or the error response returned
3118 * from the server.
3119 *
3120 * @publicApi
3121 */
3122export declare class HttpErrorResponse extends HttpResponseBase implements Error {
3123 readonly name = "HttpErrorResponse";
3124 readonly message: string;
3125 readonly error: any | null;
3126 /**
3127 * Errors are never okay, even when the status code is in the 2xx success range.
3128 */
3129 readonly ok = false;
3130 constructor(init: {
3131 error?: any;
3132 headers?: HttpHeaders;
3133 status?: number;
3134 statusText?: string;
3135 url?: string;
3136 });
3137}
3138
3139/**
3140 * Union type for all possible events on the response stream.
3141 *
3142 * Typed according to the expected type of the response.
3143 *
3144 * @publicApi
3145 */
3146export declare type HttpEvent<T> = HttpSentEvent | HttpHeaderResponse | HttpResponse<T> | HttpProgressEvent | HttpUserEvent<T>;
3147
3148/**
3149 * Type enumeration for the different kinds of `HttpEvent`.
3150 *
3151 * @publicApi
3152 */
3153export declare enum HttpEventType {
3154 /**
3155 * The request was sent out over the wire.
3156 */
3157 Sent = 0,
3158 /**
3159 * An upload progress event was received.
3160 */
3161 UploadProgress = 1,
3162 /**
3163 * The response status code and headers were received.
3164 */
3165 ResponseHeader = 2,
3166 /**
3167 * A download progress event was received.
3168 */
3169 DownloadProgress = 3,
3170 /**
3171 * The full response including the body was received.
3172 */
3173 Response = 4,
3174 /**
3175 * A custom event from an interceptor or a backend.
3176 */
3177 User = 5
3178}
3179
3180/**
3181 * Transforms an `HttpRequest` into a stream of `HttpEvent`s, one of which will likely be a
3182 * `HttpResponse`.
3183 *
3184 * `HttpHandler` is injectable. When injected, the handler instance dispatches requests to the
3185 * first interceptor in the chain, which dispatches to the second, etc, eventually reaching the
3186 * `HttpBackend`.
3187 *
3188 * In an `HttpInterceptor`, the `HttpHandler` parameter is the next interceptor in the chain.
3189 *
3190 * @publicApi
3191 */
3192export declare abstract class HttpHandler {
3193 abstract handle(req: HttpRequest<any>): Observable<HttpEvent<any>>;
3194}
3195
3196/**
3197 * A partial HTTP response which only includes the status and header data,
3198 * but no response body.
3199 *
3200 * `HttpHeaderResponse` is a `HttpEvent` available on the response
3201 * event stream, only when progress events are requested.
3202 *
3203 * @publicApi
3204 */
3205export declare class HttpHeaderResponse extends HttpResponseBase {
3206 /**
3207 * Create a new `HttpHeaderResponse` with the given parameters.
3208 */
3209 constructor(init?: {
3210 headers?: HttpHeaders;
3211 status?: number;
3212 statusText?: string;
3213 url?: string;
3214 });
3215 readonly type: HttpEventType.ResponseHeader;
3216 /**
3217 * Copy this `HttpHeaderResponse`, overriding its contents with the
3218 * given parameter hash.
3219 */
3220 clone(update?: {
3221 headers?: HttpHeaders;
3222 status?: number;
3223 statusText?: string;
3224 url?: string;
3225 }): HttpHeaderResponse;
3226}
3227
3228
3229/**
3230 * Represents the header configuration options for an HTTP request.
3231 * Instances are immutable. Modifying methods return a cloned
3232 * instance with the change. The original object is never changed.
3233 *
3234 * @publicApi
3235 */
3236export declare class HttpHeaders {
3237 /**
3238 * Internal map of lowercase header names to values.
3239 */
3240 private headers;
3241 /**
3242 * Internal map of lowercased header names to the normalized
3243 * form of the name (the form seen first).
3244 */
3245 private normalizedNames;
3246 /**
3247 * Complete the lazy initialization of this object (needed before reading).
3248 */
3249 private lazyInit;
3250 /**
3251 * Queued updates to be materialized the next initialization.
3252 */
3253 private lazyUpdate;
3254 /** Constructs a new HTTP header object with the given values.*/
3255 constructor(headers?: string | {
3256 [name: string]: string | string[];
3257 });
3258 /**
3259 * Checks for existence of a given header.
3260 *
3261 * @param name The header name to check for existence.
3262 *
3263 * @returns True if the header exists, false otherwise.
3264 */
3265 has(name: string): boolean;
3266 /**
3267 * Retrieves the first value of a given header.
3268 *
3269 * @param name The header name.
3270 *
3271 * @returns The value string if the header exists, null otherwise
3272 */
3273 get(name: string): string | null;
3274 /**
3275 * Retrieves the names of the headers.
3276 *
3277 * @returns A list of header names.
3278 */
3279 keys(): string[];
3280 /**
3281 * Retrieves a list of values for a given header.
3282 *
3283 * @param name The header name from which to retrieve values.
3284 *
3285 * @returns A string of values if the header exists, null otherwise.
3286 */
3287 getAll(name: string): string[] | null;
3288 /**
3289 * Appends a new value to the existing set of values for a header
3290 * and returns them in a clone of the original instance.
3291 *
3292 * @param name The header name for which to append the values.
3293 * @param value The value to append.
3294 *
3295 * @returns A clone of the HTTP headers object with the value appended to the given header.
3296 */
3297 append(name: string, value: string | string[]): HttpHeaders;
3298 /**
3299 * Sets or modifies a value for a given header in a clone of the original instance.
3300 * If the header already exists, its value is replaced with the given value
3301 * in the returned object.
3302 *
3303 * @param name The header name.
3304 * @param value The value or values to set or overide for the given header.
3305 *
3306 * @returns A clone of the HTTP headers object with the newly set header value.
3307 */
3308 set(name: string, value: string | string[]): HttpHeaders;
3309 /**
3310 * Deletes values for a given header in a clone of the original instance.
3311 *
3312 * @param name The header name.
3313 * @param value The value or values to delete for the given header.
3314 *
3315 * @returns A clone of the HTTP headers object with the given value deleted.
3316 */
3317 delete(name: string, value?: string | string[]): HttpHeaders;
3318 private maybeSetNormalizedName;
3319 private init;
3320 private copyFrom;
3321 private clone;
3322 private applyUpdate;
3323}
3324
3325/**
3326 * Intercepts and handles an `HttpRequest` or `HttpResponse`.
3327 *
3328 * Most interceptors transform the outgoing request before passing it to the
3329 * next interceptor in the chain, by calling `next.handle(transformedReq)`.
3330 * An interceptor may transform the
3331 * response event stream as well, by applying additional RxJS operators on the stream
3332 * returned by `next.handle()`.
3333 *
3334 * More rarely, an interceptor may handle the request entirely,
3335 * and compose a new event stream instead of invoking `next.handle()`. This is an
3336 * acceptable behavior, but keep in mind that further interceptors will be skipped entirely.
3337 *
3338 * It is also rare but valid for an interceptor to return multiple responses on the
3339 * event stream for a single request.
3340 *
3341 * @publicApi
3342 *
3343 * @see [HTTP Guide](guide/http#intercepting-requests-and-responses)
3344 *
3345 * @usageNotes
3346 *
3347 * To use the same instance of `HttpInterceptors` for the entire app, import the `HttpClientModule`
3348 * only in your `AppModule`, and add the interceptors to the root application injector.
3349 * If you import `HttpClientModule` multiple times across different modules (for example, in lazy
3350 * loading modules), each import creates a new copy of the `HttpClientModule`, which overwrites the
3351 * interceptors provided in the root module.
3352 *
3353 */
3354export declare interface HttpInterceptor {
3355 /**
3356 * Identifies and handles a given HTTP request.
3357 * @param req The outgoing request object to handle.
3358 * @param next The next interceptor in the chain, or the backend
3359 * if no interceptors remain in the chain.
3360 * @returns An observable of the event stream.
3361 */
3362 intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
3363}
3364
3365
3366/**
3367 * A codec for encoding and decoding parameters in URLs.
3368 *
3369 * Used by `HttpParams`.
3370 *
3371 * @publicApi
3372 **/
3373export declare interface HttpParameterCodec {
3374 encodeKey(key: string): string;
3375 encodeValue(value: string): string;
3376 decodeKey(key: string): string;
3377 decodeValue(value: string): string;
3378}
3379
3380/**
3381 * An HTTP request/response body that represents serialized parameters,
3382 * per the MIME type `application/x-www-form-urlencoded`.
3383 *
3384 * This class is immutable; all mutation operations return a new instance.
3385 *
3386 * @publicApi
3387 */
3388export declare class HttpParams {
3389 private map;
3390 private encoder;
3391 private updates;
3392 private cloneFrom;
3393 constructor(options?: HttpParamsOptions);
3394 /**
3395 * Reports whether the body includes one or more values for a given parameter.
3396 * @param param The parameter name.
3397 * @returns True if the parameter has one or more values,
3398 * false if it has no value or is not present.
3399 */
3400 has(param: string): boolean;
3401 /**
3402 * Retrieves the first value for a parameter.
3403 * @param param The parameter name.
3404 * @returns The first value of the given parameter,
3405 * or `null` if the parameter is not present.
3406 */
3407 get(param: string): string | null;
3408 /**
3409 * Retrieves all values for a parameter.
3410 * @param param The parameter name.
3411 * @returns All values in a string array,
3412 * or `null` if the parameter not present.
3413 */
3414 getAll(param: string): string[] | null;
3415 /**
3416 * Retrieves all the parameters for this body.
3417 * @returns The parameter names in a string array.
3418 */
3419 keys(): string[];
3420 /**
3421 * Appends a new value to existing values for a parameter.
3422 * @param param The parameter name.
3423 * @param value The new value to add.
3424 * @return A new body with the appended value.
3425 */
3426 append(param: string, value: string | number | boolean): HttpParams;
3427 /**
3428 * Constructs a new body with appended values for the given parameter name.
3429 * @param params parameters and values
3430 * @return A new body with the new value.
3431 */
3432 appendAll(params: {
3433 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
3434 }): HttpParams;
3435 /**
3436 * Replaces the value for a parameter.
3437 * @param param The parameter name.
3438 * @param value The new value.
3439 * @return A new body with the new value.
3440 */
3441 set(param: string, value: string | number | boolean): HttpParams;
3442 /**
3443 * Removes a given value or all values from a parameter.
3444 * @param param The parameter name.
3445 * @param value The value to remove, if provided.
3446 * @return A new body with the given value removed, or with all values
3447 * removed if no value is specified.
3448 */
3449 delete(param: string, value?: string | number | boolean): HttpParams;
3450 /**
3451 * Serializes the body to an encoded string, where key-value pairs (separated by `=`) are
3452 * separated by `&`s.
3453 */
3454 toString(): string;
3455 private clone;
3456 private init;
3457}
3458
3459/**
3460 * Options used to construct an `HttpParams` instance.
3461 *
3462 * @publicApi
3463 */
3464export declare interface HttpParamsOptions {
3465 /**
3466 * String representation of the HTTP parameters in URL-query-string format.
3467 * Mutually exclusive with `fromObject`.
3468 */
3469 fromString?: string;
3470 /** Object map of the HTTP parameters. Mutually exclusive with `fromString`. */
3471 fromObject?: {
3472 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
3473 };
3474 /** Encoding codec used to parse and serialize the parameters. */
3475 encoder?: HttpParameterCodec;
3476}
3477
3478/**
3479 * Base interface for progress events.
3480 *
3481 * @publicApi
3482 */
3483export declare interface HttpProgressEvent {
3484 /**
3485 * Progress event type is either upload or download.
3486 */
3487 type: HttpEventType.DownloadProgress | HttpEventType.UploadProgress;
3488 /**
3489 * Number of bytes uploaded or downloaded.
3490 */
3491 loaded: number;
3492 /**
3493 * Total number of bytes to upload or download. Depending on the request or
3494 * response, this may not be computable and thus may not be present.
3495 */
3496 total?: number;
3497}
3498
3499/**
3500 * An outgoing HTTP request with an optional typed body.
3501 *
3502 * `HttpRequest` represents an outgoing request, including URL, method,
3503 * headers, body, and other request configuration options. Instances should be
3504 * assumed to be immutable. To modify a `HttpRequest`, the `clone`
3505 * method should be used.
3506 *
3507 * @publicApi
3508 */
3509export declare class HttpRequest<T> {
3510 readonly url: string;
3511 /**
3512 * The request body, or `null` if one isn't set.
3513 *
3514 * Bodies are not enforced to be immutable, as they can include a reference to any
3515 * user-defined data type. However, interceptors should take care to preserve
3516 * idempotence by treating them as such.
3517 */
3518 readonly body: T | null;
3519 /**
3520 * Outgoing headers for this request.
3521 */
3522 readonly headers: HttpHeaders;
3523 /**
3524 * Shared and mutable context that can be used by interceptors
3525 */
3526 readonly context: HttpContext;
3527 /**
3528 * Whether this request should be made in a way that exposes progress events.
3529 *
3530 * Progress events are expensive (change detection runs on each event) and so
3531 * they should only be requested if the consumer intends to monitor them.
3532 */
3533 readonly reportProgress: boolean;
3534 /**
3535 * Whether this request should be sent with outgoing credentials (cookies).
3536 */
3537 readonly withCredentials: boolean;
3538 /**
3539 * The expected response type of the server.
3540 *
3541 * This is used to parse the response appropriately before returning it to
3542 * the requestee.
3543 */
3544 readonly responseType: 'arraybuffer' | 'blob' | 'json' | 'text';
3545 /**
3546 * The outgoing HTTP request method.
3547 */
3548 readonly method: string;
3549 /**
3550 * Outgoing URL parameters.
3551 *
3552 * To pass a string representation of HTTP parameters in the URL-query-string format,
3553 * the `HttpParamsOptions`' `fromString` may be used. For example:
3554 *
3555 * ```
3556 * new HttpParams({fromString: 'angular=awesome'})
3557 * ```
3558 */
3559 readonly params: HttpParams;
3560 /**
3561 * The outgoing URL with all URL parameters set.
3562 */
3563 readonly urlWithParams: string;
3564 constructor(method: 'DELETE' | 'GET' | 'HEAD' | 'JSONP' | 'OPTIONS', url: string, init?: {
3565 headers?: HttpHeaders;
3566 context?: HttpContext;
3567 reportProgress?: boolean;
3568 params?: HttpParams;
3569 responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
3570 withCredentials?: boolean;
3571 });
3572 constructor(method: 'POST' | 'PUT' | 'PATCH', url: string, body: T | null, init?: {
3573 headers?: HttpHeaders;
3574 context?: HttpContext;
3575 reportProgress?: boolean;
3576 params?: HttpParams;
3577 responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
3578 withCredentials?: boolean;
3579 });
3580 constructor(method: string, url: string, body: T | null, init?: {
3581 headers?: HttpHeaders;
3582 context?: HttpContext;
3583 reportProgress?: boolean;
3584 params?: HttpParams;
3585 responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
3586 withCredentials?: boolean;
3587 });
3588 /**
3589 * Transform the free-form body into a serialized format suitable for
3590 * transmission to the server.
3591 */
3592 serializeBody(): ArrayBuffer | Blob | FormData | string | null;
3593 /**
3594 * Examine the body and attempt to infer an appropriate MIME type
3595 * for it.
3596 *
3597 * If no such type can be inferred, this method will return `null`.
3598 */
3599 detectContentTypeHeader(): string | null;
3600 clone(): HttpRequest<T>;
3601 clone(update: {
3602 headers?: HttpHeaders;
3603 context?: HttpContext;
3604 reportProgress?: boolean;
3605 params?: HttpParams;
3606 responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
3607 withCredentials?: boolean;
3608 body?: T | null;
3609 method?: string;
3610 url?: string;
3611 setHeaders?: {
3612 [name: string]: string | string[];
3613 };
3614 setParams?: {
3615 [param: string]: string;
3616 };
3617 }): HttpRequest<T>;
3618 clone<V>(update: {
3619 headers?: HttpHeaders;
3620 context?: HttpContext;
3621 reportProgress?: boolean;
3622 params?: HttpParams;
3623 responseType?: 'arraybuffer' | 'blob' | 'json' | 'text';
3624 withCredentials?: boolean;
3625 body?: V | null;
3626 method?: string;
3627 url?: string;
3628 setHeaders?: {
3629 [name: string]: string | string[];
3630 };
3631 setParams?: {
3632 [param: string]: string;
3633 };
3634 }): HttpRequest<V>;
3635}
3636
3637/**
3638 * A full HTTP response, including a typed response body (which may be `null`
3639 * if one was not returned).
3640 *
3641 * `HttpResponse` is a `HttpEvent` available on the response event
3642 * stream.
3643 *
3644 * @publicApi
3645 */
3646export declare class HttpResponse<T> extends HttpResponseBase {
3647 /**
3648 * The response body, or `null` if one was not returned.
3649 */
3650 readonly body: T | null;
3651 /**
3652 * Construct a new `HttpResponse`.
3653 */
3654 constructor(init?: {
3655 body?: T | null;
3656 headers?: HttpHeaders;
3657 status?: number;
3658 statusText?: string;
3659 url?: string;
3660 });
3661 readonly type: HttpEventType.Response;
3662 clone(): HttpResponse<T>;
3663 clone(update: {
3664 headers?: HttpHeaders;
3665 status?: number;
3666 statusText?: string;
3667 url?: string;
3668 }): HttpResponse<T>;
3669 clone<V>(update: {
3670 body?: V | null;
3671 headers?: HttpHeaders;
3672 status?: number;
3673 statusText?: string;
3674 url?: string;
3675 }): HttpResponse<V>;
3676}
3677
3678/**
3679 * Base class for both `HttpResponse` and `HttpHeaderResponse`.
3680 *
3681 * @publicApi
3682 */
3683export declare abstract class HttpResponseBase {
3684 /**
3685 * All response headers.
3686 */
3687 readonly headers: HttpHeaders;
3688 /**
3689 * Response status code.
3690 */
3691 readonly status: number;
3692 /**
3693 * Textual description of response status code, defaults to OK.
3694 *
3695 * Do not depend on this.
3696 */
3697 readonly statusText: string;
3698 /**
3699 * URL of the resource retrieved, or null if not available.
3700 */
3701 readonly url: string | null;
3702 /**
3703 * Whether the status code falls in the 2xx range.
3704 */
3705 readonly ok: boolean;
3706 /**
3707 * Type of the response, narrowed to either the full response or the header.
3708 */
3709 readonly type: HttpEventType.Response | HttpEventType.ResponseHeader;
3710 /**
3711 * Super-constructor for all responses.
3712 *
3713 * The single parameter accepted is an initialization hash. Any properties
3714 * of the response passed there will override the default values.
3715 */
3716 constructor(init: {
3717 headers?: HttpHeaders;
3718 status?: number;
3719 statusText?: string;
3720 url?: string;
3721 }, defaultStatus?: number, defaultStatusText?: string);
3722}
3723
3724/**
3725 * An event indicating that the request was sent to the server. Useful
3726 * when a request may be retried multiple times, to distinguish between
3727 * retries on the final event stream.
3728 *
3729 * @publicApi
3730 */
3731export declare interface HttpSentEvent {
3732 type: HttpEventType.Sent;
3733}
3734
3735/**
3736 * Http status codes.
3737 * As per https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
3738 * @publicApi
3739 */
3740export declare const enum HttpStatusCode {
3741 Continue = 100,
3742 SwitchingProtocols = 101,
3743 Processing = 102,
3744 EarlyHints = 103,
3745 Ok = 200,
3746 Created = 201,
3747 Accepted = 202,
3748 NonAuthoritativeInformation = 203,
3749 NoContent = 204,
3750 ResetContent = 205,
3751 PartialContent = 206,
3752 MultiStatus = 207,
3753 AlreadyReported = 208,
3754 ImUsed = 226,
3755 MultipleChoices = 300,
3756 MovedPermanently = 301,
3757 Found = 302,
3758 SeeOther = 303,
3759 NotModified = 304,
3760 UseProxy = 305,
3761 Unused = 306,
3762 TemporaryRedirect = 307,
3763 PermanentRedirect = 308,
3764 BadRequest = 400,
3765 Unauthorized = 401,
3766 PaymentRequired = 402,
3767 Forbidden = 403,
3768 NotFound = 404,
3769 MethodNotAllowed = 405,
3770 NotAcceptable = 406,
3771 ProxyAuthenticationRequired = 407,
3772 RequestTimeout = 408,
3773 Conflict = 409,
3774 Gone = 410,
3775 LengthRequired = 411,
3776 PreconditionFailed = 412,
3777 PayloadTooLarge = 413,
3778 UriTooLong = 414,
3779 UnsupportedMediaType = 415,
3780 RangeNotSatisfiable = 416,
3781 ExpectationFailed = 417,
3782 ImATeapot = 418,
3783 MisdirectedRequest = 421,
3784 UnprocessableEntity = 422,
3785 Locked = 423,
3786 FailedDependency = 424,
3787 TooEarly = 425,
3788 UpgradeRequired = 426,
3789 PreconditionRequired = 428,
3790 TooManyRequests = 429,
3791 RequestHeaderFieldsTooLarge = 431,
3792 UnavailableForLegalReasons = 451,
3793 InternalServerError = 500,
3794 NotImplemented = 501,
3795 BadGateway = 502,
3796 ServiceUnavailable = 503,
3797 GatewayTimeout = 504,
3798 HttpVersionNotSupported = 505,
3799 VariantAlsoNegotiates = 506,
3800 InsufficientStorage = 507,
3801 LoopDetected = 508,
3802 NotExtended = 510,
3803 NetworkAuthenticationRequired = 511
3804}
3805
3806/**
3807 * An upload progress event.
3808 *
3809 * @publicApi
3810 */
3811export declare interface HttpUploadProgressEvent extends HttpProgressEvent {
3812 type: HttpEventType.UploadProgress;
3813}
3814
3815/**
3816 * Provides encoding and decoding of URL parameter and query-string values.
3817 *
3818 * Serializes and parses URL parameter keys and values to encode and decode them.
3819 * If you pass URL query parameters without encoding,
3820 * the query parameters can be misinterpreted at the receiving end.
3821 *
3822 *
3823 * @publicApi
3824 */
3825export declare class HttpUrlEncodingCodec implements HttpParameterCodec {
3826 /**
3827 * Encodes a key name for a URL parameter or query-string.
3828 * @param key The key name.
3829 * @returns The encoded key name.
3830 */
3831 encodeKey(key: string): string;
3832 /**
3833 * Encodes the value of a URL parameter or query-string.
3834 * @param value The value.
3835 * @returns The encoded value.
3836 */
3837 encodeValue(value: string): string;
3838 /**
3839 * Decodes an encoded URL parameter or query-string key.
3840 * @param key The encoded key name.
3841 * @returns The decoded key name.
3842 */
3843 decodeKey(key: string): string;
3844 /**
3845 * Decodes an encoded URL parameter or query-string value.
3846 * @param value The encoded value.
3847 * @returns The decoded value.
3848 */
3849 decodeValue(value: string): string;
3850}
3851
3852/**
3853 * A user-defined event.
3854 *
3855 * Grouping all custom events under this type ensures they will be handled
3856 * and forwarded by all implementations of interceptors.
3857 *
3858 * @publicApi
3859 */
3860export declare interface HttpUserEvent<T> {
3861 type: HttpEventType.User;
3862}
3863
3864/**
3865 * Uses `XMLHttpRequest` to send requests to a backend server.
3866 * @see `HttpHandler`
3867 * @see `JsonpClientBackend`
3868 *
3869 * @publicApi
3870 */
3871export declare class HttpXhrBackend implements HttpBackend {
3872 private xhrFactory;
3873 constructor(xhrFactory: XhrFactory_2);
3874 /**
3875 * Processes a request and returns a stream of response events.
3876 * @param req The request object.
3877 * @returns An observable of the response events.
3878 */
3879 handle(req: HttpRequest<any>): Observable<HttpEvent<any>>;
3880 static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<HttpXhrBackend, never>;
3881 static ɵprov: ɵngcc0.ɵɵInjectableDeclaration<HttpXhrBackend>;
3882}
3883
3884/**
3885 * Retrieves the current XSRF token to use with the next outgoing request.
3886 *
3887 * @publicApi
3888 */
3889export declare abstract class HttpXsrfTokenExtractor {
3890 /**
3891 * Get the XSRF token to use with an outgoing request.
3892 *
3893 * Will be called for every request, so the token may change between requests.
3894 */
3895 abstract getToken(): string | null;
3896}
3897
3898/**
3899 * Processes an `HttpRequest` with the JSONP method,
3900 * by performing JSONP style requests.
3901 * @see `HttpHandler`
3902 * @see `HttpXhrBackend`
3903 *
3904 * @publicApi
3905 */
3906export declare class JsonpClientBackend implements HttpBackend {
3907 private callbackMap;
3908 private document;
3909 /**
3910 * A resolved promise that can be used to schedule microtasks in the event handlers.
3911 */
3912 private readonly resolvedPromise;
3913 constructor(callbackMap: ɵangular_packages_common_http_http_b, document: any);
3914 /**
3915 * Get the name of the next callback method, by incrementing the global `nextRequestId`.
3916 */
3917 private nextCallback;
3918 /**
3919 * Processes a JSONP request and returns an event stream of the results.
3920 * @param req The request object.
3921 * @returns An observable of the response events.
3922 *
3923 */
3924 handle(req: HttpRequest<never>): Observable<HttpEvent<any>>;
3925 static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<JsonpClientBackend, never>;
3926 static ɵprov: ɵngcc0.ɵɵInjectableDeclaration<JsonpClientBackend>;
3927}
3928
3929/**
3930 * Identifies requests with the method JSONP and
3931 * shifts them to the `JsonpClientBackend`.
3932 *
3933 * @see `HttpInterceptor`
3934 *
3935 * @publicApi
3936 */
3937export declare class JsonpInterceptor {
3938 private jsonp;
3939 constructor(jsonp: JsonpClientBackend);
3940 /**
3941 * Identifies and handles a given JSONP request.
3942 * @param req The outgoing request object to handle.
3943 * @param next The next interceptor in the chain, or the backend
3944 * if no interceptors remain in the chain.
3945 * @returns An observable of the event stream.
3946 */
3947 intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
3948 static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<JsonpInterceptor, never>;
3949 static ɵprov: ɵngcc0.ɵɵInjectableDeclaration<JsonpInterceptor>;
3950}
3951
3952/**
3953 * A wrapper around the `XMLHttpRequest` constructor.
3954 *
3955 * @publicApi
3956 * @see `XhrFactory`
3957 * @deprecated
3958 * `XhrFactory` has moved, please import `XhrFactory` from `@angular/common` instead.
3959 */
3960export declare type XhrFactory = XhrFactory_2;
3961
3962/**
3963 * A wrapper around the `XMLHttpRequest` constructor.
3964 *
3965 * @publicApi
3966 * @see `XhrFactory`
3967 * @deprecated
3968 * `XhrFactory` has moved, please import `XhrFactory` from `@angular/common` instead.
3969 */
3970export declare const XhrFactory: typeof XhrFactory_2;
3971
3972export declare class ɵangular_packages_common_http_http_a implements HttpInterceptor {
3973 intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
3974 static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<ɵangular_packages_common_http_http_a, never>;
3975 static ɵprov: ɵngcc0.ɵɵInjectableDeclaration<ɵangular_packages_common_http_http_a>;
3976}
3977
3978/**
3979 * DI token/abstract type representing a map of JSONP callbacks.
3980 *
3981 * In the browser, this should always be the `window` object.
3982 *
3983 *
3984 */
3985export declare abstract class ɵangular_packages_common_http_http_b {
3986 [key: string]: (data: any) => void;
3987}
3988
3989/**
3990 * Factory function that determines where to store JSONP callbacks.
3991 *
3992 * Ordinarily JSONP callbacks are stored on the `window` object, but this may not exist
3993 * in test environments. In that case, callbacks are stored on an anonymous object instead.
3994 *
3995 *
3996 */
3997export declare function ɵangular_packages_common_http_http_c(): Object;
3998
3999export declare const ɵangular_packages_common_http_http_d: InjectionToken<string>;
4000
4001export declare const ɵangular_packages_common_http_http_e: InjectionToken<string>;
4002
4003/**
4004 * `HttpXsrfTokenExtractor` which retrieves the token from a cookie.
4005 */
4006export declare class ɵangular_packages_common_http_http_f implements HttpXsrfTokenExtractor {
4007 private doc;
4008 private platform;
4009 private cookieName;
4010 private lastCookieString;
4011 private lastToken;
4012 constructor(doc: any, platform: string, cookieName: string);
4013 getToken(): string | null;
4014 static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<ɵangular_packages_common_http_http_f, never>;
4015 static ɵprov: ɵngcc0.ɵɵInjectableDeclaration<ɵangular_packages_common_http_http_f>;
4016}
4017
4018/**
4019 * `HttpInterceptor` which adds an XSRF token to eligible outgoing requests.
4020 */
4021export declare class ɵangular_packages_common_http_http_g implements HttpInterceptor {
4022 private tokenService;
4023 private headerName;
4024 constructor(tokenService: HttpXsrfTokenExtractor, headerName: string);
4025 intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>>;
4026 static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<ɵangular_packages_common_http_http_g, never>;
4027 static ɵprov: ɵngcc0.ɵɵInjectableDeclaration<ɵangular_packages_common_http_http_g>;
4028}
4029
4030/**
4031 * An injectable `HttpHandler` that applies multiple interceptors
4032 * to a request before passing it to the given `HttpBackend`.
4033 *
4034 * The interceptors are loaded lazily from the injector, to allow
4035 * interceptors to themselves inject classes depending indirectly
4036 * on `HttpInterceptingHandler` itself.
4037 * @see `HttpInterceptor`
4038 */
4039export declare class ɵHttpInterceptingHandler implements HttpHandler {
4040 private backend;
4041 private injector;
4042 private chain;
4043 constructor(backend: HttpBackend, injector: Injector);
4044 handle(req: HttpRequest<any>): Observable<HttpEvent<any>>;
4045 static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<ɵHttpInterceptingHandler, never>;
4046 static ɵprov: ɵngcc0.ɵɵInjectableDeclaration<ɵHttpInterceptingHandler>;
4047}
4048
4049export { }
4050
4051//# sourceMappingURL=http.d.ts.map
Note: See TracBrowser for help on using the repository browser.