index.d.ts 144 KB

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