http.d.ts 118 KB

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