@angular/http
Advanced tools
Comparing version 8.0.0-beta.4 to 8.0.0-beta.5
/** | ||
* @license Angular v8.0.0-beta.4 | ||
* @license Angular v8.0.0-beta.5 | ||
* (c) 2010-2019 Google LLC. https://angular.io/ | ||
@@ -4,0 +4,0 @@ * License: MIT |
/** | ||
* @license Angular v8.0.0-beta.4 | ||
* @license Angular v8.0.0-beta.5 | ||
* (c) 2010-2019 Google LLC. https://angular.io/ | ||
@@ -4,0 +4,0 @@ * License: MIT |
/** | ||
* @license Angular v8.0.0-beta.4 | ||
* @license Angular v8.0.0-beta.5 | ||
* (c) 2010-2019 Google LLC. https://angular.io/ | ||
@@ -90,3 +90,3 @@ * License: MIT | ||
*/ | ||
function Z(){return new D}function ee(e,t){return new $(e,t)}function te(e,t){return new W(e,t)}var ne=function(){return a([t.NgModule({providers:[{provide:$,useFactory:ee,deps:[H,J]},f,{provide:J,useClass:U},{provide:m,useClass:_},H,{provide:R,useFactory:Z}]})],function e(){})}(),re=function(){return a([t.NgModule({providers:[{provide:W,useFactory:te,deps:[j,J]},N,{provide:J,useClass:U},{provide:m,useClass:_},j]})],function e(){})}(),oe=new t.Version("8.0.0-beta.4"); | ||
function Z(){return new D}function ee(e,t){return new $(e,t)}function te(e,t){return new W(e,t)}var ne=function(){return a([t.NgModule({providers:[{provide:$,useFactory:ee,deps:[H,J]},f,{provide:J,useClass:U},{provide:m,useClass:_},H,{provide:R,useFactory:Z}]})],function e(){})}(),re=function(){return a([t.NgModule({providers:[{provide:W,useFactory:te,deps:[j,J]},N,{provide:J,useClass:U},{provide:m,useClass:_},j]})],function e(){})}(),oe=new t.Version("8.0.0-beta.5"); | ||
/** | ||
@@ -93,0 +93,0 @@ * @license |
@@ -23,3 +23,3 @@ /** | ||
*/ | ||
export const VERSION = new Version('8.0.0-beta.4'); | ||
export const VERSION = new Version('8.0.0-beta.5'); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2h0dHAvc3JjL3ZlcnNpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7OztBQWNBLE9BQU8sRUFBQyxPQUFPLEVBQUMsTUFBTSxlQUFlLENBQUM7Ozs7OztBQUt0QyxNQUFNLE9BQU8sT0FBTyxHQUFHLElBQUksT0FBTyxDQUFDLG1CQUFtQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBAbGljZW5zZVxuICogQ29weXJpZ2h0IEdvb2dsZSBJbmMuIEFsbCBSaWdodHMgUmVzZXJ2ZWQuXG4gKlxuICogVXNlIG9mIHRoaXMgc291cmNlIGNvZGUgaXMgZ292ZXJuZWQgYnkgYW4gTUlULXN0eWxlIGxpY2Vuc2UgdGhhdCBjYW4gYmVcbiAqIGZvdW5kIGluIHRoZSBMSUNFTlNFIGZpbGUgYXQgaHR0cHM6Ly9hbmd1bGFyLmlvL2xpY2Vuc2VcbiAqL1xuXG4vKipcbiAqIEBtb2R1bGVcbiAqIEBkZXNjcmlwdGlvblxuICogRW50cnkgcG9pbnQgZm9yIGFsbCBwdWJsaWMgQVBJcyBvZiB0aGUgY29tbW9uIHBhY2thZ2UuXG4gKi9cblxuaW1wb3J0IHtWZXJzaW9ufSBmcm9tICdAYW5ndWxhci9jb3JlJztcbi8qKlxuICogQGRlcHJlY2F0ZWQgc2VlIGh0dHBzOi8vYW5ndWxhci5pby9ndWlkZS9odHRwXG4gKiBAcHVibGljQXBpXG4gKi9cbmV4cG9ydCBjb25zdCBWRVJTSU9OID0gbmV3IFZlcnNpb24oJzAuMC4wLVBMQUNFSE9MREVSJyk7XG4iXX0= |
@@ -18,3 +18,3 @@ /** | ||
*/ | ||
export var VERSION = new Version('8.0.0-beta.4'); | ||
export var VERSION = new Version('8.0.0-beta.5'); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2h0dHAvc3JjL3ZlcnNpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUg7Ozs7R0FJRztBQUVILE9BQU8sRUFBQyxPQUFPLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFDdEM7OztHQUdHO0FBQ0gsTUFBTSxDQUFDLElBQU0sT0FBTyxHQUFHLElBQUksT0FBTyxDQUFDLG1CQUFtQixDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEBsaWNlbnNlXG4gKiBDb3B5cmlnaHQgR29vZ2xlIEluYy4gQWxsIFJpZ2h0cyBSZXNlcnZlZC5cbiAqXG4gKiBVc2Ugb2YgdGhpcyBzb3VyY2UgY29kZSBpcyBnb3Zlcm5lZCBieSBhbiBNSVQtc3R5bGUgbGljZW5zZSB0aGF0IGNhbiBiZVxuICogZm91bmQgaW4gdGhlIExJQ0VOU0UgZmlsZSBhdCBodHRwczovL2FuZ3VsYXIuaW8vbGljZW5zZVxuICovXG5cbi8qKlxuICogQG1vZHVsZVxuICogQGRlc2NyaXB0aW9uXG4gKiBFbnRyeSBwb2ludCBmb3IgYWxsIHB1YmxpYyBBUElzIG9mIHRoZSBjb21tb24gcGFja2FnZS5cbiAqL1xuXG5pbXBvcnQge1ZlcnNpb259IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuLyoqXG4gKiBAZGVwcmVjYXRlZCBzZWUgaHR0cHM6Ly9hbmd1bGFyLmlvL2d1aWRlL2h0dHBcbiAqIEBwdWJsaWNBcGlcbiAqL1xuZXhwb3J0IGNvbnN0IFZFUlNJT04gPSBuZXcgVmVyc2lvbignMC4wLjAtUExBQ0VIT0xERVInKTtcbiJdfQ== |
/** | ||
* @license Angular v8.0.0-beta.4 | ||
* @license Angular v8.0.0-beta.5 | ||
* (c) 2010-2019 Google LLC. https://angular.io/ | ||
@@ -4,0 +4,0 @@ * License: MIT |
/** | ||
* @license Angular v8.0.0-beta.4 | ||
* @license Angular v8.0.0-beta.5 | ||
* (c) 2010-2019 Google LLC. https://angular.io/ | ||
@@ -4,0 +4,0 @@ * License: MIT |
1061
http.d.ts
/** | ||
* Generated bundle index. Do not edit. | ||
* @license Angular v8.0.0-beta.5 | ||
* (c) 2010-2019 Google LLC. https://angular.io/ | ||
* License: MIT | ||
*/ | ||
export * from './index'; | ||
export { BrowserJsonp as ɵangular_packages_http_http_e } from './src/backends/browser_jsonp'; | ||
export { Body as ɵangular_packages_http_http_f } from './src/body'; | ||
export { _createDefaultCookieXSRFStrategy as ɵangular_packages_http_http_a, httpFactory as ɵangular_packages_http_http_b, jsonpFactory as ɵangular_packages_http_http_c } from './src/http_module'; | ||
export { RequestArgs as ɵangular_packages_http_http_d } from './src/interfaces'; | ||
import { Observable } from 'rxjs'; | ||
import { Version } from '@angular/core'; | ||
/** | ||
* Subclass of {@link RequestOptions}, with default values. | ||
* | ||
* Default values: | ||
* * method: {@link RequestMethod RequestMethod.Get} | ||
* * headers: empty {@link Headers} object | ||
* | ||
* This class could be extended and bound to the {@link RequestOptions} class | ||
* when configuring an {@link Injector}, in order to override the default options | ||
* used by {@link Http} to create and send {@link Request Requests}. | ||
* | ||
* ```typescript | ||
* import {BaseRequestOptions, RequestOptions} from '@angular/http'; | ||
* | ||
* class MyOptions extends BaseRequestOptions { | ||
* search: string = 'coreTeam=true'; | ||
* } | ||
* | ||
* {provide: RequestOptions, useClass: MyOptions}; | ||
* ``` | ||
* | ||
* The options could also be extended when manually creating a {@link Request} | ||
* object. | ||
* | ||
* ``` | ||
* import {BaseRequestOptions, Request, RequestMethod} from '@angular/http'; | ||
* | ||
* const options = new BaseRequestOptions(); | ||
* const req = new Request(options.merge({ | ||
* method: RequestMethod.Post, | ||
* url: 'https://google.com' | ||
* })); | ||
* console.log('req.method:', RequestMethod[req.method]); // Post | ||
* console.log('options.url:', options.url); // null | ||
* console.log('req.url:', req.url); // https://google.com | ||
* ``` | ||
* | ||
* @deprecated see https://angular.io/guide/http | ||
* @publicApi | ||
*/ | ||
export declare class BaseRequestOptions extends RequestOptions { | ||
constructor(); | ||
} | ||
/** | ||
* Subclass of {@link ResponseOptions}, with default values. | ||
* | ||
* Default values: | ||
* * status: 200 | ||
* * headers: empty {@link Headers} object | ||
* | ||
* This class could be extended and bound to the {@link ResponseOptions} class | ||
* when configuring an {@link Injector}, in order to override the default options | ||
* used by {@link Http} to create {@link Response Responses}. | ||
* | ||
* @usageNotes | ||
* ### Example | ||
* | ||
* ```typescript | ||
* import {provide} from '@angular/core'; | ||
* import {bootstrap} from '@angular/platform-browser/browser'; | ||
* import {HTTP_PROVIDERS, Headers, Http, BaseResponseOptions, ResponseOptions} from | ||
* '@angular/http'; | ||
* import {App} from './myapp'; | ||
* | ||
* class MyOptions extends BaseResponseOptions { | ||
* headers:Headers = new Headers({network: 'github'}); | ||
* } | ||
* | ||
* bootstrap(App, [HTTP_PROVIDERS, {provide: ResponseOptions, useClass: MyOptions}]); | ||
* ``` | ||
* | ||
* The options could also be extended when manually creating a {@link Response} | ||
* object. | ||
* | ||
* ### Example | ||
* | ||
* ``` | ||
* import {BaseResponseOptions, Response} from '@angular/http'; | ||
* | ||
* var options = new BaseResponseOptions(); | ||
* var res = new Response(options.merge({ | ||
* body: 'Angular', | ||
* headers: new Headers({framework: 'angular'}) | ||
* })); | ||
* console.log('res.headers.get("framework"):', res.headers.get('framework')); // angular | ||
* console.log('res.text():', res.text()); // Angular; | ||
* ``` | ||
* | ||
* @deprecated see https://angular.io/guide/http | ||
* @publicApi | ||
*/ | ||
export declare class BaseResponseOptions extends ResponseOptions { | ||
constructor(); | ||
} | ||
/** | ||
* A backend for http that uses the `XMLHttpRequest` browser API. | ||
* | ||
* Take care not to evaluate this in non-browser contexts. | ||
* | ||
* @deprecated see https://angular.io/guide/http | ||
* @publicApi | ||
*/ | ||
export declare class BrowserXhr { | ||
constructor(); | ||
build(): any; | ||
} | ||
/** | ||
* Abstract class from which real connections are derived. | ||
* | ||
* @deprecated see https://angular.io/guide/http | ||
* @publicApi | ||
*/ | ||
export declare abstract class Connection { | ||
readyState: ReadyState; | ||
request: Request; | ||
response: any; | ||
} | ||
/** | ||
* Abstract class from which real backends are derived. | ||
* | ||
* The primary purpose of a `ConnectionBackend` is to create new connections to fulfill a given | ||
* {@link Request}. | ||
* | ||
* @deprecated see https://angular.io/guide/http | ||
* @publicApi | ||
*/ | ||
export declare abstract class ConnectionBackend { | ||
abstract createConnection(request: any): Connection; | ||
} | ||
/** | ||
* Supported content type to be automatically associated with a {@link Request}. | ||
* @deprecated see https://angular.io/guide/http | ||
*/ | ||
declare enum ContentType { | ||
NONE = 0, | ||
JSON = 1, | ||
FORM = 2, | ||
FORM_DATA = 3, | ||
TEXT = 4, | ||
BLOB = 5, | ||
ARRAY_BUFFER = 6 | ||
} | ||
/** | ||
* `XSRFConfiguration` sets up Cross Site Request Forgery (XSRF) protection for the application | ||
* using a cookie. See https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF) | ||
* for more information on XSRF. | ||
* | ||
* Applications can configure custom cookie and header names by binding an instance of this class | ||
* with different `cookieName` and `headerName` values. See the main HTTP documentation for more | ||
* details. | ||
* | ||
* @deprecated see https://angular.io/guide/http | ||
* @publicApi | ||
*/ | ||
export declare class CookieXSRFStrategy implements XSRFStrategy { | ||
private _cookieName; | ||
private _headerName; | ||
constructor(_cookieName?: string, _headerName?: string); | ||
configureRequest(req: Request): void; | ||
} | ||
/** | ||
* Polyfill for [Headers](https://developer.mozilla.org/en-US/docs/Web/API/Headers/Headers), as | ||
* specified in the [Fetch Spec](https://fetch.spec.whatwg.org/#headers-class). | ||
* | ||
* The only known difference between this `Headers` implementation and the spec is the | ||
* lack of an `entries` method. | ||
* | ||
* @usageNotes | ||
* ### Example | ||
* | ||
* ``` | ||
* import {Headers} from '@angular/http'; | ||
* | ||
* var firstHeaders = new Headers(); | ||
* firstHeaders.append('Content-Type', 'image/jpeg'); | ||
* console.log(firstHeaders.get('Content-Type')) //'image/jpeg' | ||
* | ||
* // Create headers from Plain Old JavaScript Object | ||
* var secondHeaders = new Headers({ | ||
* 'X-My-Custom-Header': 'Angular' | ||
* }); | ||
* console.log(secondHeaders.get('X-My-Custom-Header')); //'Angular' | ||
* | ||
* var thirdHeaders = new Headers(secondHeaders); | ||
* console.log(thirdHeaders.get('X-My-Custom-Header')); //'Angular' | ||
* ``` | ||
* | ||
* @deprecated see https://angular.io/guide/http | ||
* @publicApi | ||
*/ | ||
export declare class Headers { | ||
constructor(headers?: Headers | { | ||
[name: string]: any; | ||
} | null); | ||
/** | ||
* Returns a new Headers instance from the given DOMString of Response Headers | ||
*/ | ||
static fromResponseHeaderString(headersString: string): Headers; | ||
/** | ||
* Appends a header to existing list of header values for a given header name. | ||
*/ | ||
append(name: string, value: string): void; | ||
/** | ||
* Deletes all header values for the given name. | ||
*/ | ||
delete(name: string): void; | ||
forEach(fn: (values: string[], name: string | undefined, headers: Map<string, string[]>) => void): void; | ||
/** | ||
* Returns first header that matches given name. | ||
*/ | ||
get(name: string): string | null; | ||
/** | ||
* Checks for existence of header by given name. | ||
*/ | ||
has(name: string): boolean; | ||
/** | ||
* Returns the names of the headers | ||
*/ | ||
keys(): string[]; | ||
/** | ||
* Sets or overrides header value for given name. | ||
*/ | ||
set(name: string, value: string | string[]): void; | ||
/** | ||
* Returns values of all headers. | ||
*/ | ||
values(): string[][]; | ||
/** | ||
* Returns string of all headers. | ||
*/ | ||
toJSON(): { | ||
[name: string]: any; | ||
}; | ||
/** | ||
* Returns list of header values for a given name. | ||
*/ | ||
getAll(name: string): string[] | null; | ||
/** | ||
* This method is not implemented. | ||
*/ | ||
entries(): void; | ||
private mayBeSetNormalizedName; | ||
} | ||
/** | ||
* Performs http requests using `XMLHttpRequest` as the default backend. | ||
* | ||
* `Http` is available as an injectable class, with methods to perform http requests. Calling | ||
* `request` returns an `Observable` which will emit a single {@link Response} when a | ||
* response is received. | ||
* | ||
* @usageNotes | ||
* ### Example | ||
* | ||
* ```typescript | ||
* import {Http, HTTP_PROVIDERS} from '@angular/http'; | ||
* import {map} from 'rxjs/operators'; | ||
* | ||
* @Component({ | ||
* selector: 'http-app', | ||
* viewProviders: [HTTP_PROVIDERS], | ||
* templateUrl: 'people.html' | ||
* }) | ||
* class PeopleComponent { | ||
* constructor(http: Http) { | ||
* http.get('people.json') | ||
* // Call map on the response observable to get the parsed people object | ||
* .pipe(map(res => res.json())) | ||
* // Subscribe to the observable to get the parsed people object and attach it to the | ||
* // component | ||
* .subscribe(people => this.people = people); | ||
* } | ||
* } | ||
* ``` | ||
* | ||
* | ||
* ### Example | ||
* | ||
* ``` | ||
* http.get('people.json').subscribe((res:Response) => this.people = res.json()); | ||
* ``` | ||
* | ||
* The default construct used to perform requests, `XMLHttpRequest`, is abstracted as a "Backend" ( | ||
* {@link XHRBackend} in this case), which could be mocked with dependency injection by replacing | ||
* the {@link XHRBackend} provider, as in the following example: | ||
* | ||
* ### Example | ||
* | ||
* ```typescript | ||
* import {BaseRequestOptions, Http} from '@angular/http'; | ||
* import {MockBackend} from '@angular/http/testing'; | ||
* var injector = Injector.resolveAndCreate([ | ||
* BaseRequestOptions, | ||
* MockBackend, | ||
* {provide: Http, useFactory: | ||
* function(backend, defaultOptions) { | ||
* return new Http(backend, defaultOptions); | ||
* }, | ||
* deps: [MockBackend, BaseRequestOptions]} | ||
* ]); | ||
* var http = injector.get(Http); | ||
* http.get('request-from-mock-backend.json').subscribe((res:Response) => doSomething(res)); | ||
* ``` | ||
* | ||
* @deprecated see https://angular.io/guide/http | ||
* @publicApi | ||
*/ | ||
export declare class Http { | ||
protected _backend: ConnectionBackend; | ||
protected _defaultOptions: RequestOptions; | ||
constructor(_backend: ConnectionBackend, _defaultOptions: RequestOptions); | ||
/** | ||
* Performs any type of http request. First argument is required, and can either be a url or | ||
* a {@link Request} instance. If the first argument is a url, an optional {@link RequestOptions} | ||
* object can be provided as the 2nd argument. The options object will be merged with the values | ||
* of {@link BaseRequestOptions} before performing the request. | ||
*/ | ||
request(url: string | Request, options?: RequestOptionsArgs): Observable<Response>; | ||
/** | ||
* Performs a request with `get` http method. | ||
*/ | ||
get(url: string, options?: RequestOptionsArgs): Observable<Response>; | ||
/** | ||
* Performs a request with `post` http method. | ||
*/ | ||
post(url: string, body: any, options?: RequestOptionsArgs): Observable<Response>; | ||
/** | ||
* Performs a request with `put` http method. | ||
*/ | ||
put(url: string, body: any, options?: RequestOptionsArgs): Observable<Response>; | ||
/** | ||
* Performs a request with `delete` http method. | ||
*/ | ||
delete(url: string, options?: RequestOptionsArgs): Observable<Response>; | ||
/** | ||
* Performs a request with `patch` http method. | ||
*/ | ||
patch(url: string, body: any, options?: RequestOptionsArgs): Observable<Response>; | ||
/** | ||
* Performs a request with `head` http method. | ||
*/ | ||
head(url: string, options?: RequestOptionsArgs): Observable<Response>; | ||
/** | ||
* Performs a request with `options` http method. | ||
*/ | ||
options(url: string, options?: RequestOptionsArgs): Observable<Response>; | ||
} | ||
/** | ||
* The module that includes http's providers | ||
* | ||
* @deprecated see https://angular.io/guide/http | ||
* @publicApi | ||
*/ | ||
export declare class HttpModule { | ||
} | ||
/** | ||
* @deprecated see https://angular.io/guide/http | ||
* @publicApi | ||
*/ | ||
export declare class Jsonp extends Http { | ||
constructor(backend: ConnectionBackend, defaultOptions: RequestOptions); | ||
/** | ||
* Performs any type of http request. First argument is required, and can either be a url or | ||
* a {@link Request} instance. If the first argument is a url, an optional {@link RequestOptions} | ||
* object can be provided as the 2nd argument. The options object will be merged with the values | ||
* of {@link BaseRequestOptions} before performing the request. | ||
* | ||
* @security Regular XHR is the safest alternative to JSONP for most applications, and is | ||
* supported by all current browsers. Because JSONP creates a `<script>` element with | ||
* contents retrieved from a remote source, attacker-controlled data introduced by an untrusted | ||
* source could expose your application to XSS risks. Data exposed by JSONP may also be | ||
* readable by malicious third-party websites. In addition, JSONP introduces potential risk for | ||
* future security issues (e.g. content sniffing). For more detail, see the | ||
* [Security Guide](http://g.co/ng/security). | ||
*/ | ||
request(url: string | Request, options?: RequestOptionsArgs): Observable<Response>; | ||
} | ||
/** | ||
* A {@link ConnectionBackend} that uses the JSONP strategy of making requests. | ||
* | ||
* @deprecated see https://angular.io/guide/http | ||
* @publicApi | ||
*/ | ||
export declare class JSONPBackend extends ConnectionBackend { | ||
private _browserJSONP; | ||
private _baseResponseOptions; | ||
createConnection(request: Request): JSONPConnection; | ||
} | ||
/** | ||
* Base class for an in-flight JSONP request. | ||
* | ||
* @deprecated see https://angular.io/guide/http | ||
* @publicApi | ||
*/ | ||
export declare class JSONPConnection implements Connection { | ||
private _dom; | ||
private baseResponseOptions?; | ||
private _id; | ||
private _script; | ||
private _responseData; | ||
private _finished; | ||
/** | ||
* The {@link ReadyState} of this request. | ||
*/ | ||
readyState: ReadyState; | ||
/** | ||
* The outgoing HTTP request. | ||
*/ | ||
request: Request; | ||
/** | ||
* An observable that completes with the response, when the request is finished. | ||
*/ | ||
response: Observable<Response>; | ||
/** | ||
* Callback called when the JSONP request completes, to notify the application | ||
* of the new data. | ||
*/ | ||
finished(data?: any): void; | ||
} | ||
/** | ||
* The module that includes jsonp's providers | ||
* | ||
* @deprecated see https://angular.io/guide/http | ||
* @publicApi | ||
*/ | ||
export declare class JsonpModule { | ||
} | ||
/** | ||
* @deprecated see https://angular.io/guide/http | ||
* @publicApi | ||
**/ | ||
export declare class QueryEncoder { | ||
encodeKey(key: string): string; | ||
encodeValue(value: string): string; | ||
} | ||
/** | ||
* All possible states in which a connection can be, based on | ||
* [States](http://www.w3.org/TR/XMLHttpRequest/#states) from the `XMLHttpRequest` spec, but with an | ||
* additional "CANCELLED" state. | ||
* @deprecated see https://angular.io/guide/http | ||
* @publicApi | ||
*/ | ||
export declare enum ReadyState { | ||
Unsent = 0, | ||
Open = 1, | ||
HeadersReceived = 2, | ||
Loading = 3, | ||
Done = 4, | ||
Cancelled = 5 | ||
} | ||
/** | ||
* Creates `Request` instances from provided values. | ||
* | ||
* The Request's interface is inspired by the Request constructor defined in the [Fetch | ||
* Spec](https://fetch.spec.whatwg.org/#request-class), | ||
* but is considered a static value whose body can be accessed many times. There are other | ||
* differences in the implementation, but this is the most significant. | ||
* | ||
* `Request` instances are typically created by higher-level classes, like {@link Http} and | ||
* {@link Jsonp}, but it may occasionally be useful to explicitly create `Request` instances. | ||
* One such example is when creating services that wrap higher-level services, like {@link Http}, | ||
* where it may be useful to generate a `Request` with arbitrary headers and search params. | ||
* | ||
* ```typescript | ||
* import {Injectable, Injector} from '@angular/core'; | ||
* import {HTTP_PROVIDERS, Http, Request, RequestMethod} from '@angular/http'; | ||
* | ||
* @Injectable() | ||
* class AutoAuthenticator { | ||
* constructor(public http:Http) {} | ||
* request(url:string) { | ||
* return this.http.request(new Request({ | ||
* method: RequestMethod.Get, | ||
* url: url, | ||
* search: 'password=123' | ||
* })); | ||
* } | ||
* } | ||
* | ||
* var injector = Injector.resolveAndCreate([HTTP_PROVIDERS, AutoAuthenticator]); | ||
* var authenticator = injector.get(AutoAuthenticator); | ||
* authenticator.request('people.json').subscribe(res => { | ||
* //URL should have included '?password=123' | ||
* console.log('people', res.json()); | ||
* }); | ||
* ``` | ||
* | ||
* @deprecated see https://angular.io/guide/http | ||
* @publicApi | ||
*/ | ||
export declare class Request extends ɵangular_packages_http_http_f { | ||
/** | ||
* Http method with which to perform the request. | ||
*/ | ||
method: RequestMethod; | ||
/** | ||
* {@link Headers} instance | ||
*/ | ||
headers: Headers; | ||
/** Url of the remote resource */ | ||
url: string; | ||
/** Type of the request body **/ | ||
private contentType; | ||
/** Enable use credentials */ | ||
withCredentials: boolean; | ||
/** Buffer to store the response */ | ||
responseType: ResponseContentType; | ||
constructor(requestOptions: ɵangular_packages_http_http_d); | ||
/** | ||
* Returns the content type enum based on header options. | ||
*/ | ||
detectContentType(): ContentType; | ||
/** | ||
* Returns the content type of request's body based on its type. | ||
*/ | ||
detectContentTypeFromBody(): ContentType; | ||
/** | ||
* Returns the request's body according to its type. If body is undefined, return | ||
* null. | ||
*/ | ||
getBody(): any; | ||
} | ||
/** | ||
* Supported http methods. | ||
* @deprecated see https://angular.io/guide/http | ||
* @publicApi | ||
*/ | ||
export declare enum RequestMethod { | ||
Get = 0, | ||
Post = 1, | ||
Put = 2, | ||
Delete = 3, | ||
Options = 4, | ||
Head = 5, | ||
Patch = 6 | ||
} | ||
/** | ||
* Creates a request options object to be optionally provided when instantiating a | ||
* {@link Request}. | ||
* | ||
* This class is based on the `RequestInit` description in the [Fetch | ||
* Spec](https://fetch.spec.whatwg.org/#requestinit). | ||
* | ||
* All values are null by default. Typical defaults can be found in the {@link BaseRequestOptions} | ||
* class, which sub-classes `RequestOptions`. | ||
* | ||
* ```typescript | ||
* import {RequestOptions, Request, RequestMethod} from '@angular/http'; | ||
* | ||
* const options = new RequestOptions({ | ||
* method: RequestMethod.Post, | ||
* url: 'https://google.com' | ||
* }); | ||
* const req = new Request(options); | ||
* console.log('req.method:', RequestMethod[req.method]); // Post | ||
* console.log('options.url:', options.url); // https://google.com | ||
* ``` | ||
* | ||
* @deprecated see https://angular.io/guide/http | ||
* @publicApi | ||
*/ | ||
export declare class RequestOptions { | ||
/** | ||
* Http method with which to execute a {@link Request}. | ||
* Acceptable methods are defined in the {@link RequestMethod} enum. | ||
*/ | ||
method: RequestMethod | string | null; | ||
/** | ||
* {@link Headers} to be attached to a {@link Request}. | ||
*/ | ||
headers: Headers | null; | ||
/** | ||
* Body to be used when creating a {@link Request}. | ||
*/ | ||
body: any; | ||
/** | ||
* Url with which to perform a {@link Request}. | ||
*/ | ||
url: string | null; | ||
/** | ||
* Search parameters to be included in a {@link Request}. | ||
*/ | ||
params: URLSearchParams; | ||
/** | ||
* @deprecated from 4.0.0. Use params instead. | ||
*/ | ||
/** | ||
* @deprecated from 4.0.0. Use params instead. | ||
*/ | ||
search: URLSearchParams; | ||
/** | ||
* Enable use credentials for a {@link Request}. | ||
*/ | ||
withCredentials: boolean | null; | ||
responseType: ResponseContentType | null; | ||
constructor(opts?: RequestOptionsArgs); | ||
/** | ||
* Creates a copy of the `RequestOptions` instance, using the optional input as values to override | ||
* existing values. This method will not change the values of the instance on which it is being | ||
* called. | ||
* | ||
* Note that `headers` and `search` will override existing values completely if present in | ||
* the `options` object. If these values should be merged, it should be done prior to calling | ||
* `merge` on the `RequestOptions` instance. | ||
* | ||
* ```typescript | ||
* import {RequestOptions, Request, RequestMethod} from '@angular/http'; | ||
* | ||
* const options = new RequestOptions({ | ||
* method: RequestMethod.Post | ||
* }); | ||
* const req = new Request(options.merge({ | ||
* url: 'https://google.com' | ||
* })); | ||
* console.log('req.method:', RequestMethod[req.method]); // Post | ||
* console.log('options.url:', options.url); // null | ||
* console.log('req.url:', req.url); // https://google.com | ||
* ``` | ||
*/ | ||
merge(options?: RequestOptionsArgs): RequestOptions; | ||
private _mergeSearchParams; | ||
private _parseParams; | ||
private _appendParam; | ||
} | ||
/** | ||
* Interface for options to construct a RequestOptions, based on | ||
* [RequestInit](https://fetch.spec.whatwg.org/#requestinit) from the Fetch spec. | ||
* | ||
* @deprecated see https://angular.io/guide/http | ||
* @publicApi | ||
*/ | ||
export declare interface RequestOptionsArgs { | ||
url?: string | null; | ||
method?: string | RequestMethod | null; | ||
/** @deprecated from 4.0.0. Use params instead. */ | ||
search?: string | URLSearchParams | { | ||
[key: string]: any | any[]; | ||
} | null; | ||
params?: string | URLSearchParams | { | ||
[key: string]: any | any[]; | ||
} | null; | ||
headers?: Headers | null; | ||
body?: any; | ||
withCredentials?: boolean | null; | ||
responseType?: ResponseContentType | null; | ||
} | ||
/** | ||
* Creates `Response` instances from provided values. | ||
* | ||
* Though this object isn't | ||
* usually instantiated by end-users, it is the primary object interacted with when it comes time to | ||
* add data to a view. | ||
* | ||
* @usageNotes | ||
* ### Example | ||
* | ||
* ``` | ||
* http.request('my-friends.txt').subscribe(response => this.friends = response.text()); | ||
* ``` | ||
* | ||
* The Response's interface is inspired by the Response constructor defined in the [Fetch | ||
* Spec](https://fetch.spec.whatwg.org/#response-class), but is considered a static value whose body | ||
* can be accessed many times. There are other differences in the implementation, but this is the | ||
* most significant. | ||
* | ||
* @deprecated see https://angular.io/guide/http | ||
* @publicApi | ||
*/ | ||
export declare class Response extends ɵangular_packages_http_http_f { | ||
/** | ||
* One of "basic", "cors", "default", "error", or "opaque". | ||
* | ||
* Defaults to "default". | ||
*/ | ||
type: ResponseType; | ||
/** | ||
* True if the response's status is within 200-299 | ||
*/ | ||
ok: boolean; | ||
/** | ||
* URL of response. | ||
* | ||
* Defaults to empty string. | ||
*/ | ||
url: string; | ||
/** | ||
* Status code returned by server. | ||
* | ||
* Defaults to 200. | ||
*/ | ||
status: number; | ||
/** | ||
* Text representing the corresponding reason phrase to the `status`, as defined in [ietf rfc 2616 | ||
* section 6.1.1](https://tools.ietf.org/html/rfc2616#section-6.1.1) | ||
* | ||
* Defaults to "OK" | ||
*/ | ||
statusText: string | null; | ||
/** | ||
* Non-standard property | ||
* | ||
* Denotes how many of the response body's bytes have been loaded, for example if the response is | ||
* the result of a progress event. | ||
*/ | ||
bytesLoaded: number; | ||
/** | ||
* Non-standard property | ||
* | ||
* Denotes how many bytes are expected in the final response body. | ||
*/ | ||
totalBytes: number; | ||
/** | ||
* Headers object based on the `Headers` class in the [Fetch | ||
* Spec](https://fetch.spec.whatwg.org/#headers-class). | ||
*/ | ||
headers: Headers | null; | ||
constructor(responseOptions: ResponseOptions); | ||
toString(): string; | ||
} | ||
/** | ||
* Define which buffer to use to store the response | ||
* @deprecated see https://angular.io/guide/http | ||
* @publicApi | ||
*/ | ||
export declare enum ResponseContentType { | ||
Text = 0, | ||
Json = 1, | ||
ArrayBuffer = 2, | ||
Blob = 3 | ||
} | ||
/** | ||
* Creates a response options object to be optionally provided when instantiating a | ||
* {@link Response}. | ||
* | ||
* This class is based on the `ResponseInit` description in the [Fetch | ||
* Spec](https://fetch.spec.whatwg.org/#responseinit). | ||
* | ||
* All values are null by default. Typical defaults can be found in the | ||
* {@link BaseResponseOptions} class, which sub-classes `ResponseOptions`. | ||
* | ||
* This class may be used in tests to build {@link Response Responses} for | ||
* mock responses (see {@link MockBackend}). | ||
* | ||
* @usageNotes | ||
* ### Example | ||
* | ||
* ```typescript | ||
* import {ResponseOptions, Response} from '@angular/http'; | ||
* | ||
* var options = new ResponseOptions({ | ||
* body: '{"name":"Jeff"}' | ||
* }); | ||
* var res = new Response(options); | ||
* | ||
* console.log('res.json():', res.json()); // Object {name: "Jeff"} | ||
* ``` | ||
* | ||
* @deprecated see https://angular.io/guide/http | ||
* @publicApi | ||
*/ | ||
export declare class ResponseOptions { | ||
/** | ||
* String, Object, ArrayBuffer or Blob representing the body of the {@link Response}. | ||
*/ | ||
body: string | Object | ArrayBuffer | Blob | null; | ||
/** | ||
* Http {@link http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html status code} | ||
* associated with the response. | ||
*/ | ||
status: number | null; | ||
/** | ||
* Response {@link Headers headers} | ||
*/ | ||
headers: Headers | null; | ||
url: string | null; | ||
constructor(opts?: ResponseOptionsArgs); | ||
/** | ||
* Creates a copy of the `ResponseOptions` instance, using the optional input as values to | ||
* override | ||
* existing values. This method will not change the values of the instance on which it is being | ||
* called. | ||
* | ||
* This may be useful when sharing a base `ResponseOptions` object inside tests, | ||
* where certain properties may change from test to test. | ||
* | ||
* @usageNotes | ||
* ### Example | ||
* | ||
* ```typescript | ||
* import {ResponseOptions, Response} from '@angular/http'; | ||
* | ||
* var options = new ResponseOptions({ | ||
* body: {name: 'Jeff'} | ||
* }); | ||
* var res = new Response(options.merge({ | ||
* url: 'https://google.com' | ||
* })); | ||
* console.log('options.url:', options.url); // null | ||
* console.log('res.json():', res.json()); // Object {name: "Jeff"} | ||
* console.log('res.url:', res.url); // https://google.com | ||
* ``` | ||
*/ | ||
merge(options?: ResponseOptionsArgs): ResponseOptions; | ||
} | ||
/** | ||
* Interface for options to construct a Response, based on | ||
* [ResponseInit](https://fetch.spec.whatwg.org/#responseinit) from the Fetch spec. | ||
* | ||
* @deprecated see https://angular.io/guide/http | ||
* @publicApi | ||
*/ | ||
export declare interface ResponseOptionsArgs { | ||
body?: string | Object | FormData | ArrayBuffer | Blob | null; | ||
status?: number | null; | ||
statusText?: string | null; | ||
headers?: Headers | null; | ||
type?: ResponseType | null; | ||
url?: string | null; | ||
} | ||
/** | ||
* Acceptable response types to be associated with a {@link Response}, based on | ||
* [ResponseType](https://fetch.spec.whatwg.org/#responsetype) from the Fetch spec. | ||
* @deprecated see https://angular.io/guide/http | ||
* @publicApi | ||
*/ | ||
export declare enum ResponseType { | ||
Basic = 0, | ||
Cors = 1, | ||
Default = 2, | ||
Error = 3, | ||
Opaque = 4 | ||
} | ||
/** | ||
* Map-like representation of url search parameters, based on | ||
* [URLSearchParams](https://url.spec.whatwg.org/#urlsearchparams) in the url living standard, | ||
* with several extensions for merging URLSearchParams objects: | ||
* - setAll() | ||
* - appendAll() | ||
* - replaceAll() | ||
* | ||
* This class accepts an optional second parameter of ${@link QueryEncoder}, | ||
* which is used to serialize parameters before making a request. By default, | ||
* `QueryEncoder` encodes keys and values of parameters using `encodeURIComponent`, | ||
* and then un-encodes certain characters that are allowed to be part of the query | ||
* according to IETF RFC 3986: https://tools.ietf.org/html/rfc3986. | ||
* | ||
* These are the characters that are not encoded: `! $ \' ( ) * + , ; A 9 - . _ ~ ? /` | ||
* | ||
* If the set of allowed query characters is not acceptable for a particular backend, | ||
* `QueryEncoder` can be subclassed and provided as the 2nd argument to URLSearchParams. | ||
* | ||
* ``` | ||
* import {URLSearchParams, QueryEncoder} from '@angular/http'; | ||
* class MyQueryEncoder extends QueryEncoder { | ||
* encodeKey(k: string): string { | ||
* return myEncodingFunction(k); | ||
* } | ||
* | ||
* encodeValue(v: string): string { | ||
* return myEncodingFunction(v); | ||
* } | ||
* } | ||
* | ||
* let params = new URLSearchParams('', new MyQueryEncoder()); | ||
* ``` | ||
* @deprecated see https://angular.io/guide/http | ||
* @publicApi | ||
*/ | ||
export declare class URLSearchParams { | ||
rawParams: string; | ||
private queryEncoder; | ||
paramsMap: Map<string, string[]>; | ||
constructor(rawParams?: string, queryEncoder?: QueryEncoder); | ||
clone(): URLSearchParams; | ||
has(param: string): boolean; | ||
get(param: string): string | null; | ||
getAll(param: string): string[]; | ||
set(param: string, val: string): void; | ||
setAll(searchParams: URLSearchParams): void; | ||
append(param: string, val: string): void; | ||
appendAll(searchParams: URLSearchParams): void; | ||
replaceAll(searchParams: URLSearchParams): void; | ||
toString(): string; | ||
delete(param: string): void; | ||
} | ||
/** | ||
* @deprecated see https://angular.io/guide/http | ||
* @publicApi | ||
*/ | ||
export declare const VERSION: Version; | ||
/** | ||
* Creates {@link XHRConnection} instances. | ||
* | ||
* This class would typically not be used by end users, but could be | ||
* overridden if a different backend implementation should be used, | ||
* such as in a node backend. | ||
* | ||
* @usageNotes | ||
* ### Example | ||
* | ||
* ``` | ||
* import {Http, MyNodeBackend, HTTP_PROVIDERS, BaseRequestOptions} from '@angular/http'; | ||
* @Component({ | ||
* viewProviders: [ | ||
* HTTP_PROVIDERS, | ||
* {provide: Http, useFactory: (backend, options) => { | ||
* return new Http(backend, options); | ||
* }, deps: [MyNodeBackend, BaseRequestOptions]}] | ||
* }) | ||
* class MyComponent { | ||
* constructor(http:Http) { | ||
* http.request('people.json').subscribe(res => this.people = res.json()); | ||
* } | ||
* } | ||
* ``` | ||
* @deprecated see https://angular.io/guide/http | ||
* @publicApi | ||
*/ | ||
export declare class XHRBackend implements ConnectionBackend { | ||
private _browserXHR; | ||
private _baseResponseOptions; | ||
private _xsrfStrategy; | ||
constructor(_browserXHR: BrowserXhr, _baseResponseOptions: ResponseOptions, _xsrfStrategy: XSRFStrategy); | ||
createConnection(request: Request): XHRConnection; | ||
} | ||
/** | ||
* Creates connections using `XMLHttpRequest`. Given a fully-qualified | ||
* request, an `XHRConnection` will immediately create an `XMLHttpRequest` object and send the | ||
* request. | ||
* | ||
* This class would typically not be created or interacted with directly inside applications, though | ||
* the {@link MockConnection} may be interacted with in tests. | ||
* | ||
* @deprecated see https://angular.io/guide/http | ||
* @publicApi | ||
*/ | ||
export declare class XHRConnection implements Connection { | ||
request: Request; | ||
/** | ||
* Response {@link EventEmitter} which emits a single {@link Response} value on load event of | ||
* `XMLHttpRequest`. | ||
*/ | ||
response: Observable<Response>; | ||
readyState: ReadyState; | ||
constructor(req: Request, browserXHR: BrowserXhr, baseResponseOptions?: ResponseOptions); | ||
setDetectedContentType(req: any /** TODO Request */, _xhr: any /** XMLHttpRequest */): void; | ||
} | ||
/** | ||
* An XSRFStrategy configures XSRF protection (e.g. via headers) on an HTTP request. | ||
* | ||
* @deprecated see https://angular.io/guide/http | ||
* @publicApi | ||
*/ | ||
export declare abstract class XSRFStrategy { | ||
abstract configureRequest(req: Request): void; | ||
} | ||
export declare function ɵangular_packages_http_http_a(): CookieXSRFStrategy; | ||
export declare function ɵangular_packages_http_http_b(xhrBackend: XHRBackend, requestOptions: RequestOptions): Http; | ||
export declare function ɵangular_packages_http_http_c(jsonpBackend: JSONPBackend, requestOptions: RequestOptions): Jsonp; | ||
/** | ||
* Required structure when constructing new Request(); | ||
*/ | ||
export declare interface ɵangular_packages_http_http_d extends RequestOptionsArgs { | ||
url: string | null; | ||
} | ||
export declare class ɵangular_packages_http_http_e { | ||
build(url: string): any; | ||
nextRequestID(): string; | ||
requestCallback(id: string): string; | ||
exposeConnection(id: string, connection: any): void; | ||
removeConnection(id: string): void; | ||
send(node: any): void; | ||
cleanup(node: any): void; | ||
} | ||
/** | ||
* HTTP request body used by both {@link Request} and {@link Response} | ||
* https://fetch.spec.whatwg.org/#body | ||
*/ | ||
export declare abstract class ɵangular_packages_http_http_f { | ||
/** | ||
* Attempts to return body as parsed `JSON` object, or raises an exception. | ||
*/ | ||
json(): any; | ||
/** | ||
* Returns the body as a string, presuming `toString()` can be called on the response body. | ||
* | ||
* When decoding an `ArrayBuffer`, the optional `encodingHint` parameter determines how the | ||
* bytes in the buffer will be interpreted. Valid values are: | ||
* | ||
* - `legacy` - incorrectly interpret the bytes as UTF-16 (technically, UCS-2). Only characters | ||
* in the Basic Multilingual Plane are supported, surrogate pairs are not handled correctly. | ||
* In addition, the endianness of the 16-bit octet pairs in the `ArrayBuffer` is not taken | ||
* into consideration. This is the default behavior to avoid breaking apps, but should be | ||
* considered deprecated. | ||
* | ||
* - `iso-8859` - interpret the bytes as ISO-8859 (which can be used for ASCII encoded text). | ||
*/ | ||
text(encodingHint?: 'legacy' | 'iso-8859'): string; | ||
/** | ||
* Return the body as an ArrayBuffer | ||
*/ | ||
arrayBuffer(): ArrayBuffer; | ||
/** | ||
* Returns the request's body as a Blob, assuming that body exists. | ||
*/ | ||
blob(): Blob; | ||
} | ||
export { } |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":4,"metadata":{"ɵangular_packages_http_http_a":{"__symbolic":"function","parameters":[],"value":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"CookieXSRFStrategy"}}},"ɵangular_packages_http_http_b":{"__symbolic":"function","parameters":["xhrBackend","requestOptions"],"value":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"Http"},"arguments":[{"__symbolic":"reference","name":"xhrBackend"},{"__symbolic":"reference","name":"requestOptions"}]}},"ɵangular_packages_http_http_c":{"__symbolic":"function","parameters":["jsonpBackend","requestOptions"],"value":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"Jsonp"},"arguments":[{"__symbolic":"reference","name":"jsonpBackend"},{"__symbolic":"reference","name":"requestOptions"}]}},"ɵangular_packages_http_http_d":{"__symbolic":"interface"},"BrowserXhr":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":18,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor"}],"build":[{"__symbolic":"method"}]}},"JSONPBackend":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"ConnectionBackend"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":145,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"ɵangular_packages_http_http_e"},{"__symbolic":"reference","name":"ResponseOptions"}]}],"createConnection":[{"__symbolic":"method"}]}},"JSONPConnection":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Request"},{"__symbolic":"reference","name":"ɵangular_packages_http_http_e"},{"__symbolic":"reference","name":"ResponseOptions"}]}],"finished":[{"__symbolic":"method"}]}},"CookieXSRFStrategy":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"string"}]}],"configureRequest":[{"__symbolic":"method"}]}},"XHRBackend":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":234,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"BrowserXhr"},{"__symbolic":"reference","name":"ResponseOptions"},{"__symbolic":"reference","name":"XSRFStrategy"}]}],"createConnection":[{"__symbolic":"method"}]}},"XHRConnection":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Request"},{"__symbolic":"reference","name":"BrowserXhr"},{"__symbolic":"reference","name":"ResponseOptions"}]}],"setDetectedContentType":[{"__symbolic":"method"}]}},"BaseRequestOptions":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"RequestOptions"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":206,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor"}]}},"RequestOptions":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"RequestOptionsArgs"}]}],"merge":[{"__symbolic":"method"}],"_mergeSearchParams":[{"__symbolic":"method"}],"_parseParams":[{"__symbolic":"method"}],"_appendParam":[{"__symbolic":"method"}]}},"BaseResponseOptions":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"ResponseOptions"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":165,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor"}]}},"ResponseOptions":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"ResponseOptionsArgs"}]}],"merge":[{"__symbolic":"method"}]}},"ReadyState":{"Unsent":0,"Open":1,"HeadersReceived":2,"Loading":3,"Done":4,"Cancelled":5},"RequestMethod":{"Get":0,"Post":1,"Put":2,"Delete":3,"Options":4,"Head":5,"Patch":6},"ResponseContentType":{"Text":0,"Json":1,"ArrayBuffer":2,"Blob":3},"ResponseType":{"Basic":0,"Cors":1,"Default":2,"Error":3,"Opaque":4},"Headers":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Expression form not supported","line":45,"character":32,"module":"./src/headers"}]}],"append":[{"__symbolic":"method"}],"delete":[{"__symbolic":"method"}],"forEach":[{"__symbolic":"method"}],"get":[{"__symbolic":"method"}],"has":[{"__symbolic":"method"}],"keys":[{"__symbolic":"method"}],"set":[{"__symbolic":"method"}],"values":[{"__symbolic":"method"}],"toJSON":[{"__symbolic":"method"}],"getAll":[{"__symbolic":"method"}],"entries":[{"__symbolic":"method"}],"mayBeSetNormalizedName":[{"__symbolic":"method"}]}},"Http":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":105,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"ConnectionBackend"},{"__symbolic":"reference","name":"RequestOptions"}]}],"request":[{"__symbolic":"method"}],"get":[{"__symbolic":"method"}],"post":[{"__symbolic":"method"}],"put":[{"__symbolic":"method"}],"delete":[{"__symbolic":"method"}],"patch":[{"__symbolic":"method"}],"head":[{"__symbolic":"method"}],"options":[{"__symbolic":"method"}]}},"Jsonp":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"Http"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":194,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"ConnectionBackend"},{"__symbolic":"reference","name":"RequestOptions"}]}],"request":[{"__symbolic":"method"}]}},"HttpModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":45,"character":1},"arguments":[{"providers":[{"provide":{"__symbolic":"reference","name":"Http"},"useFactory":{"__symbolic":"reference","name":"ɵangular_packages_http_http_b"},"deps":[{"__symbolic":"reference","name":"XHRBackend"},{"__symbolic":"reference","name":"RequestOptions"}]},{"__symbolic":"reference","name":"BrowserXhr"},{"provide":{"__symbolic":"reference","name":"RequestOptions"},"useClass":{"__symbolic":"reference","name":"BaseRequestOptions"}},{"provide":{"__symbolic":"reference","name":"ResponseOptions"},"useClass":{"__symbolic":"reference","name":"BaseResponseOptions"}},{"__symbolic":"reference","name":"XHRBackend"},{"provide":{"__symbolic":"reference","name":"XSRFStrategy"},"useFactory":{"__symbolic":"reference","name":"ɵangular_packages_http_http_a"}}]}]}],"members":{}},"JsonpModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":66,"character":1},"arguments":[{"providers":[{"provide":{"__symbolic":"reference","name":"Jsonp"},"useFactory":{"__symbolic":"reference","name":"ɵangular_packages_http_http_c"},"deps":[{"__symbolic":"reference","name":"JSONPBackend"},{"__symbolic":"reference","name":"RequestOptions"}]},{"__symbolic":"reference","name":"ɵangular_packages_http_http_e"},{"provide":{"__symbolic":"reference","name":"RequestOptions"},"useClass":{"__symbolic":"reference","name":"BaseRequestOptions"}},{"provide":{"__symbolic":"reference","name":"ResponseOptions"},"useClass":{"__symbolic":"reference","name":"BaseResponseOptions"}},{"__symbolic":"reference","name":"JSONPBackend"}]}]}],"members":{}},"Connection":{"__symbolic":"class","members":{}},"ConnectionBackend":{"__symbolic":"class","members":{"createConnection":[{"__symbolic":"method"}]}},"RequestOptionsArgs":{"__symbolic":"interface"},"ResponseOptionsArgs":{"__symbolic":"interface"},"XSRFStrategy":{"__symbolic":"class","members":{"configureRequest":[{"__symbolic":"method"}]}},"Request":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"ɵangular_packages_http_http_f"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"ɵangular_packages_http_http_d"}]}],"detectContentType":[{"__symbolic":"method"}],"detectContentTypeFromBody":[{"__symbolic":"method"}],"getBody":[{"__symbolic":"method"}]}},"Response":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"ɵangular_packages_http_http_f"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"ResponseOptions"}]}],"toString":[{"__symbolic":"method"}]}},"QueryEncoder":{"__symbolic":"class","members":{"encodeKey":[{"__symbolic":"method"}],"encodeValue":[{"__symbolic":"method"}]}},"URLSearchParams":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"QueryEncoder"}]}],"clone":[{"__symbolic":"method"}],"has":[{"__symbolic":"method"}],"get":[{"__symbolic":"method"}],"getAll":[{"__symbolic":"method"}],"set":[{"__symbolic":"method"}],"setAll":[{"__symbolic":"method"}],"append":[{"__symbolic":"method"}],"appendAll":[{"__symbolic":"method"}],"replaceAll":[{"__symbolic":"method"}],"toString":[{"__symbolic":"method"}],"delete":[{"__symbolic":"method"}]}},"VERSION":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Version","line":19,"character":27},"arguments":["8.0.0-beta.4"]},"ɵangular_packages_http_http_e":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":23,"character":1}}],"members":{"build":[{"__symbolic":"method"}],"nextRequestID":[{"__symbolic":"method"}],"requestCallback":[{"__symbolic":"method"}],"exposeConnection":[{"__symbolic":"method"}],"removeConnection":[{"__symbolic":"method"}],"send":[{"__symbolic":"method"}],"cleanup":[{"__symbolic":"method"}]}},"ɵangular_packages_http_http_f":{"__symbolic":"class","members":{"json":[{"__symbolic":"method"}],"text":[{"__symbolic":"method"}],"arrayBuffer":[{"__symbolic":"method"}],"blob":[{"__symbolic":"method"}]}}},"origins":{"ɵangular_packages_http_http_a":"./src/http_module","ɵangular_packages_http_http_b":"./src/http_module","ɵangular_packages_http_http_c":"./src/http_module","ɵangular_packages_http_http_d":"./src/interfaces","BrowserXhr":"./src/backends/browser_xhr","JSONPBackend":"./src/backends/jsonp_backend","JSONPConnection":"./src/backends/jsonp_backend","CookieXSRFStrategy":"./src/backends/xhr_backend","XHRBackend":"./src/backends/xhr_backend","XHRConnection":"./src/backends/xhr_backend","BaseRequestOptions":"./src/base_request_options","RequestOptions":"./src/base_request_options","BaseResponseOptions":"./src/base_response_options","ResponseOptions":"./src/base_response_options","ReadyState":"./src/enums","RequestMethod":"./src/enums","ResponseContentType":"./src/enums","ResponseType":"./src/enums","Headers":"./src/headers","Http":"./src/http","Jsonp":"./src/http","HttpModule":"./src/http_module","JsonpModule":"./src/http_module","Connection":"./src/interfaces","ConnectionBackend":"./src/interfaces","RequestOptionsArgs":"./src/interfaces","ResponseOptionsArgs":"./src/interfaces","XSRFStrategy":"./src/interfaces","Request":"./src/static_request","Response":"./src/static_response","QueryEncoder":"./src/url_search_params","URLSearchParams":"./src/url_search_params","VERSION":"./src/version","ɵangular_packages_http_http_e":"./src/backends/browser_jsonp","ɵangular_packages_http_http_f":"./src/body"},"importAs":"@angular/http"} | ||
{"__symbolic":"module","version":4,"metadata":{"ɵangular_packages_http_http_a":{"__symbolic":"function","parameters":[],"value":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"CookieXSRFStrategy"}}},"ɵangular_packages_http_http_b":{"__symbolic":"function","parameters":["xhrBackend","requestOptions"],"value":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"Http"},"arguments":[{"__symbolic":"reference","name":"xhrBackend"},{"__symbolic":"reference","name":"requestOptions"}]}},"ɵangular_packages_http_http_c":{"__symbolic":"function","parameters":["jsonpBackend","requestOptions"],"value":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"Jsonp"},"arguments":[{"__symbolic":"reference","name":"jsonpBackend"},{"__symbolic":"reference","name":"requestOptions"}]}},"ɵangular_packages_http_http_d":{"__symbolic":"interface"},"BrowserXhr":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":18,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor"}],"build":[{"__symbolic":"method"}]}},"JSONPBackend":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"ConnectionBackend"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":145,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"ɵangular_packages_http_http_e"},{"__symbolic":"reference","name":"ResponseOptions"}]}],"createConnection":[{"__symbolic":"method"}]}},"JSONPConnection":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Request"},{"__symbolic":"reference","name":"ɵangular_packages_http_http_e"},{"__symbolic":"reference","name":"ResponseOptions"}]}],"finished":[{"__symbolic":"method"}]}},"CookieXSRFStrategy":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"string"}]}],"configureRequest":[{"__symbolic":"method"}]}},"XHRBackend":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":234,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"BrowserXhr"},{"__symbolic":"reference","name":"ResponseOptions"},{"__symbolic":"reference","name":"XSRFStrategy"}]}],"createConnection":[{"__symbolic":"method"}]}},"XHRConnection":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Request"},{"__symbolic":"reference","name":"BrowserXhr"},{"__symbolic":"reference","name":"ResponseOptions"}]}],"setDetectedContentType":[{"__symbolic":"method"}]}},"BaseRequestOptions":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"RequestOptions"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":206,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor"}]}},"RequestOptions":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"RequestOptionsArgs"}]}],"merge":[{"__symbolic":"method"}],"_mergeSearchParams":[{"__symbolic":"method"}],"_parseParams":[{"__symbolic":"method"}],"_appendParam":[{"__symbolic":"method"}]}},"BaseResponseOptions":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"ResponseOptions"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":165,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor"}]}},"ResponseOptions":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"ResponseOptionsArgs"}]}],"merge":[{"__symbolic":"method"}]}},"ReadyState":{"Unsent":0,"Open":1,"HeadersReceived":2,"Loading":3,"Done":4,"Cancelled":5},"RequestMethod":{"Get":0,"Post":1,"Put":2,"Delete":3,"Options":4,"Head":5,"Patch":6},"ResponseContentType":{"Text":0,"Json":1,"ArrayBuffer":2,"Blob":3},"ResponseType":{"Basic":0,"Cors":1,"Default":2,"Error":3,"Opaque":4},"Headers":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Expression form not supported","line":45,"character":32,"module":"./http"}]}],"append":[{"__symbolic":"method"}],"delete":[{"__symbolic":"method"}],"forEach":[{"__symbolic":"method"}],"get":[{"__symbolic":"method"}],"has":[{"__symbolic":"method"}],"keys":[{"__symbolic":"method"}],"set":[{"__symbolic":"method"}],"values":[{"__symbolic":"method"}],"toJSON":[{"__symbolic":"method"}],"getAll":[{"__symbolic":"method"}],"entries":[{"__symbolic":"method"}],"mayBeSetNormalizedName":[{"__symbolic":"method"}]}},"Http":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":105,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"ConnectionBackend"},{"__symbolic":"reference","name":"RequestOptions"}]}],"request":[{"__symbolic":"method"}],"get":[{"__symbolic":"method"}],"post":[{"__symbolic":"method"}],"put":[{"__symbolic":"method"}],"delete":[{"__symbolic":"method"}],"patch":[{"__symbolic":"method"}],"head":[{"__symbolic":"method"}],"options":[{"__symbolic":"method"}]}},"Jsonp":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"Http"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":194,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"ConnectionBackend"},{"__symbolic":"reference","name":"RequestOptions"}]}],"request":[{"__symbolic":"method"}]}},"HttpModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":45,"character":1},"arguments":[{"providers":[{"provide":{"__symbolic":"reference","name":"Http"},"useFactory":{"__symbolic":"reference","name":"ɵangular_packages_http_http_b"},"deps":[{"__symbolic":"reference","name":"XHRBackend"},{"__symbolic":"reference","name":"RequestOptions"}]},{"__symbolic":"reference","name":"BrowserXhr"},{"provide":{"__symbolic":"reference","name":"RequestOptions"},"useClass":{"__symbolic":"reference","name":"BaseRequestOptions"}},{"provide":{"__symbolic":"reference","name":"ResponseOptions"},"useClass":{"__symbolic":"reference","name":"BaseResponseOptions"}},{"__symbolic":"reference","name":"XHRBackend"},{"provide":{"__symbolic":"reference","name":"XSRFStrategy"},"useFactory":{"__symbolic":"reference","name":"ɵangular_packages_http_http_a"}}]}]}],"members":{}},"JsonpModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":66,"character":1},"arguments":[{"providers":[{"provide":{"__symbolic":"reference","name":"Jsonp"},"useFactory":{"__symbolic":"reference","name":"ɵangular_packages_http_http_c"},"deps":[{"__symbolic":"reference","name":"JSONPBackend"},{"__symbolic":"reference","name":"RequestOptions"}]},{"__symbolic":"reference","name":"ɵangular_packages_http_http_e"},{"provide":{"__symbolic":"reference","name":"RequestOptions"},"useClass":{"__symbolic":"reference","name":"BaseRequestOptions"}},{"provide":{"__symbolic":"reference","name":"ResponseOptions"},"useClass":{"__symbolic":"reference","name":"BaseResponseOptions"}},{"__symbolic":"reference","name":"JSONPBackend"}]}]}],"members":{}},"Connection":{"__symbolic":"class","members":{}},"ConnectionBackend":{"__symbolic":"class","members":{"createConnection":[{"__symbolic":"method"}]}},"RequestOptionsArgs":{"__symbolic":"interface"},"ResponseOptionsArgs":{"__symbolic":"interface"},"XSRFStrategy":{"__symbolic":"class","members":{"configureRequest":[{"__symbolic":"method"}]}},"Request":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"ɵangular_packages_http_http_f"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"ɵangular_packages_http_http_d"}]}],"detectContentType":[{"__symbolic":"method"}],"detectContentTypeFromBody":[{"__symbolic":"method"}],"getBody":[{"__symbolic":"method"}]}},"Response":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"ɵangular_packages_http_http_f"},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"ResponseOptions"}]}],"toString":[{"__symbolic":"method"}]}},"QueryEncoder":{"__symbolic":"class","members":{"encodeKey":[{"__symbolic":"method"}],"encodeValue":[{"__symbolic":"method"}]}},"URLSearchParams":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"QueryEncoder"}]}],"clone":[{"__symbolic":"method"}],"has":[{"__symbolic":"method"}],"get":[{"__symbolic":"method"}],"getAll":[{"__symbolic":"method"}],"set":[{"__symbolic":"method"}],"setAll":[{"__symbolic":"method"}],"append":[{"__symbolic":"method"}],"appendAll":[{"__symbolic":"method"}],"replaceAll":[{"__symbolic":"method"}],"toString":[{"__symbolic":"method"}],"delete":[{"__symbolic":"method"}]}},"VERSION":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"Version","line":19,"character":27},"arguments":["8.0.0-beta.5"]},"ɵangular_packages_http_http_e":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":23,"character":1}}],"members":{"build":[{"__symbolic":"method"}],"nextRequestID":[{"__symbolic":"method"}],"requestCallback":[{"__symbolic":"method"}],"exposeConnection":[{"__symbolic":"method"}],"removeConnection":[{"__symbolic":"method"}],"send":[{"__symbolic":"method"}],"cleanup":[{"__symbolic":"method"}]}},"ɵangular_packages_http_http_f":{"__symbolic":"class","members":{"json":[{"__symbolic":"method"}],"text":[{"__symbolic":"method"}],"arrayBuffer":[{"__symbolic":"method"}],"blob":[{"__symbolic":"method"}]}}},"origins":{"ɵangular_packages_http_http_a":"./http","ɵangular_packages_http_http_b":"./http","ɵangular_packages_http_http_c":"./http","ɵangular_packages_http_http_d":"./http","BrowserXhr":"./http","JSONPBackend":"./http","JSONPConnection":"./http","CookieXSRFStrategy":"./http","XHRBackend":"./http","XHRConnection":"./http","BaseRequestOptions":"./http","RequestOptions":"./http","BaseResponseOptions":"./http","ResponseOptions":"./http","ReadyState":"./http","RequestMethod":"./http","ResponseContentType":"./http","ResponseType":"./http","Headers":"./http","Http":"./http","Jsonp":"./http","HttpModule":"./http","JsonpModule":"./http","Connection":"./http","ConnectionBackend":"./http","RequestOptionsArgs":"./http","ResponseOptionsArgs":"./http","XSRFStrategy":"./http","Request":"./http","Response":"./http","QueryEncoder":"./http","URLSearchParams":"./http","VERSION":"./http","ɵangular_packages_http_http_e":"./http","ɵangular_packages_http_http_f":"./http"},"importAs":"@angular/http"} |
{ | ||
"name": "@angular/http", | ||
"version": "8.0.0-beta.4", | ||
"version": "8.0.0-beta.5", | ||
"description": "Angular - the http service", | ||
@@ -20,4 +20,4 @@ "main": "./bundles/http.umd.js", | ||
"rxjs": "^6.0.0", | ||
"@angular/core": "8.0.0-beta.4", | ||
"@angular/platform-browser": "8.0.0-beta.4" | ||
"@angular/core": "8.0.0-beta.5", | ||
"@angular/platform-browser": "8.0.0-beta.5" | ||
}, | ||
@@ -24,0 +24,0 @@ "repository": { |
/** | ||
* @license Angular v8.0.0-beta.4 | ||
* @license Angular v8.0.0-beta.5 | ||
* (c) 2010-2019 Google LLC. https://angular.io/ | ||
@@ -4,0 +4,0 @@ * License: MIT |
/** | ||
* Generated bundle index. Do not edit. | ||
* @license Angular v8.0.0-beta.5 | ||
* (c) 2010-2019 Google LLC. https://angular.io/ | ||
* License: MIT | ||
*/ | ||
export * from './index'; | ||
import { Connection } from '@angular/http'; | ||
import { ConnectionBackend } from '@angular/http'; | ||
import { ReadyState } from '@angular/http'; | ||
import { ReplaySubject } from 'rxjs'; | ||
import { Request } from '@angular/http'; | ||
import { Response } from '@angular/http'; | ||
/** | ||
* A mock backend for testing the {@link Http} service. | ||
* | ||
* This class can be injected in tests, and should be used to override providers | ||
* to other backends, such as {@link XHRBackend}. | ||
* | ||
* @usageNotes | ||
* ### Example | ||
* | ||
* ``` | ||
* import {Injectable, Injector} from '@angular/core'; | ||
* import {async, fakeAsync, tick} from '@angular/core/testing'; | ||
* import {BaseRequestOptions, ConnectionBackend, Http, RequestOptions} from '@angular/http'; | ||
* import {Response, ResponseOptions} from '@angular/http'; | ||
* import {MockBackend, MockConnection} from '@angular/http/testing'; | ||
* | ||
* const HERO_ONE = 'HeroNrOne'; | ||
* const HERO_TWO = 'WillBeAlwaysTheSecond'; | ||
* | ||
* @Injectable() | ||
* class HeroService { | ||
* constructor(private http: Http) {} | ||
* | ||
* getHeroes(): Promise<String[]> { | ||
* return this.http.get('myservices.de/api/heroes') | ||
* .toPromise() | ||
* .then(response => response.json().data) | ||
* .catch(e => this.handleError(e)); | ||
* } | ||
* | ||
* private handleError(error: any): Promise<any> { | ||
* console.error('An error occurred', error); | ||
* return Promise.reject(error.message || error); | ||
* } | ||
* } | ||
* | ||
* describe('MockBackend HeroService Example', () => { | ||
* beforeEach(() => { | ||
* this.injector = Injector.create([ | ||
* {provide: ConnectionBackend, useClass: MockBackend}, | ||
* {provide: RequestOptions, useClass: BaseRequestOptions}, | ||
* Http, | ||
* HeroService, | ||
* ]); | ||
* this.heroService = this.injector.get(HeroService); | ||
* this.backend = this.injector.get(ConnectionBackend) as MockBackend; | ||
* this.backend.connections.subscribe((connection: any) => this.lastConnection = connection); | ||
* }); | ||
* | ||
* it('getHeroes() should query current service url', () => { | ||
* this.heroService.getHeroes(); | ||
* expect(this.lastConnection).toBeDefined('no http service connection at all?'); | ||
* expect(this.lastConnection.request.url).toMatch(/api\/heroes$/, 'url invalid'); | ||
* }); | ||
* | ||
* it('getHeroes() should return some heroes', fakeAsync(() => { | ||
* let result: String[]; | ||
* this.heroService.getHeroes().then((heroes: String[]) => result = heroes); | ||
* this.lastConnection.mockRespond(new Response(new ResponseOptions({ | ||
* body: JSON.stringify({data: [HERO_ONE, HERO_TWO]}), | ||
* }))); | ||
* tick(); | ||
* expect(result.length).toEqual(2, 'should contain given amount of heroes'); | ||
* expect(result[0]).toEqual(HERO_ONE, ' HERO_ONE should be the first hero'); | ||
* expect(result[1]).toEqual(HERO_TWO, ' HERO_TWO should be the second hero'); | ||
* })); | ||
* | ||
* it('getHeroes() while server is down', fakeAsync(() => { | ||
* let result: String[]; | ||
* let catchedError: any; | ||
* this.heroService.getHeroes() | ||
* .then((heroes: String[]) => result = heroes) | ||
* .catch((error: any) => catchedError = error); | ||
* this.lastConnection.mockError(new Response(new ResponseOptions({ | ||
* status: 404, | ||
* statusText: 'URL not Found', | ||
* }))); | ||
* tick(); | ||
* expect(result).toBeUndefined(); | ||
* expect(catchedError).toBeDefined(); | ||
* })); | ||
* }); | ||
* ``` | ||
* | ||
* @deprecated see https://angular.io/guide/http | ||
* @publicApi | ||
*/ | ||
export declare class MockBackend implements ConnectionBackend { | ||
/** | ||
* {@link EventEmitter} | ||
* of {@link MockConnection} instances that have been created by this backend. Can be subscribed | ||
* to in order to respond to connections. | ||
* | ||
* This property only exists in the mock implementation, not in real Backends. | ||
*/ | ||
connections: any; | ||
/** | ||
* An array representation of `connections`. This array will be updated with each connection that | ||
* is created by this backend. | ||
* | ||
* This property only exists in the mock implementation, not in real Backends. | ||
*/ | ||
connectionsArray: MockConnection[]; | ||
/** | ||
* {@link EventEmitter} of {@link MockConnection} instances that haven't yet been resolved (i.e. | ||
* with a `readyState` | ||
* less than 4). Used internally to verify that no connections are pending via the | ||
* `verifyNoPendingRequests` method. | ||
* | ||
* This property only exists in the mock implementation, not in real Backends. | ||
*/ | ||
pendingConnections: any; | ||
constructor(); | ||
/** | ||
* Checks all connections, and raises an exception if any connection has not received a response. | ||
* | ||
* This method only exists in the mock implementation, not in real Backends. | ||
*/ | ||
verifyNoPendingRequests(): void; | ||
/** | ||
* Can be used in conjunction with `verifyNoPendingRequests` to resolve any not-yet-resolve | ||
* connections, if it's expected that there are connections that have not yet received a response. | ||
* | ||
* This method only exists in the mock implementation, not in real Backends. | ||
*/ | ||
resolveAllConnections(): void; | ||
/** | ||
* Creates a new {@link MockConnection}. This is equivalent to calling `new | ||
* MockConnection()`, except that it also will emit the new `Connection` to the `connections` | ||
* emitter of this `MockBackend` instance. This method will usually only be used by tests | ||
* against the framework itself, not by end-users. | ||
*/ | ||
createConnection(req: Request): MockConnection; | ||
} | ||
/** | ||
* | ||
* Mock Connection to represent a {@link Connection} for tests. | ||
* | ||
* @usageNotes | ||
* ### Example of `mockRespond()` | ||
* | ||
* ``` | ||
* var connection; | ||
* backend.connections.subscribe(c => connection = c); | ||
* http.request('data.json').subscribe(res => console.log(res.text())); | ||
* connection.mockRespond(new Response(new ResponseOptions({ body: 'fake response' }))); //logs | ||
* 'fake response' | ||
* ``` | ||
* | ||
* ### Example of `mockError()` | ||
* | ||
* ``` | ||
* var connection; | ||
* backend.connections.subscribe(c => connection = c); | ||
* http.request('data.json').subscribe(res => res, err => console.log(err))); | ||
* connection.mockError(new Error('error')); | ||
* ``` | ||
* | ||
* @deprecated see https://angular.io/guide/http | ||
* @publicApi | ||
*/ | ||
export declare class MockConnection implements Connection { | ||
/** | ||
* Describes the state of the connection, based on `XMLHttpRequest.readyState`, but with | ||
* additional states. For example, state 5 indicates an aborted connection. | ||
*/ | ||
readyState: ReadyState; | ||
/** | ||
* {@link Request} instance used to create the connection. | ||
*/ | ||
request: Request; | ||
/** | ||
* {@link EventEmitter} of {@link Response}. Can be subscribed to in order to be notified when a | ||
* response is available. | ||
*/ | ||
response: ReplaySubject<Response>; | ||
constructor(req: Request); | ||
/** | ||
* Sends a mock response to the connection. This response is the value that is emitted to the | ||
* {@link EventEmitter} returned by {@link Http}. | ||
* | ||
*/ | ||
mockRespond(res: Response): void; | ||
/** | ||
* Not yet implemented! | ||
* | ||
* Sends the provided {@link Response} to the `downloadObserver` of the `Request` | ||
* associated with this connection. | ||
*/ | ||
mockDownload(res: Response): void; | ||
/** | ||
* Emits the provided error object as an error to the {@link Response} {@link EventEmitter} | ||
* returned | ||
* from {@link Http}. | ||
* | ||
*/ | ||
mockError(err?: Error): void; | ||
} | ||
export { } |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":4,"metadata":{"MockConnection":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/http","name":"Request","line":61,"character":19}]}],"mockRespond":[{"__symbolic":"method"}],"mockDownload":[{"__symbolic":"method"}],"mockError":[{"__symbolic":"method"}]}},"MockBackend":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":195,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor"}],"verifyNoPendingRequests":[{"__symbolic":"method"}],"resolveAllConnections":[{"__symbolic":"method"}],"createConnection":[{"__symbolic":"method"}]}}},"origins":{"MockConnection":"./src/mock_backend","MockBackend":"./src/mock_backend"},"importAs":"@angular/http/testing"} | ||
{"__symbolic":"module","version":4,"metadata":{"MockConnection":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/http","name":"Request","line":61,"character":19}]}],"mockRespond":[{"__symbolic":"method"}],"mockDownload":[{"__symbolic":"method"}],"mockError":[{"__symbolic":"method"}]}},"MockBackend":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":195,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor"}],"verifyNoPendingRequests":[{"__symbolic":"method"}],"resolveAllConnections":[{"__symbolic":"method"}],"createConnection":[{"__symbolic":"method"}]}}},"origins":{"MockConnection":"./testing","MockBackend":"./testing"},"importAs":"@angular/http/testing"} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1380041
79
13576