index.d.ts 142 KB

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