index.d.ts 157 KB

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