@angular/http
Advanced tools
Comparing version 4.0.0-rc.3 to 4.0.0-rc.4
/** | ||
* @license Angular v4.0.0-rc.3 | ||
* @license Angular v4.0.0-rc.4 | ||
* (c) 2010-2017 Google, Inc. https://angular.io/ | ||
@@ -27,3 +27,5 @@ * License: MIT | ||
]; | ||
/** @nocollapse */ | ||
/** | ||
* @nocollapse | ||
*/ | ||
BrowserXhr.ctorParameters = () => []; | ||
@@ -128,5 +130,9 @@ | ||
constructor(headers) { | ||
/** @internal header names are lower case */ | ||
/** | ||
* \@internal header names are lower case | ||
*/ | ||
this._headers = new Map(); | ||
/** @internal map lower case names to actual names */ | ||
/** | ||
* \@internal map lower case names to actual names | ||
*/ | ||
this._normalizedNames = new Map(); | ||
@@ -411,3 +417,5 @@ if (!headers) { | ||
]; | ||
/** @nocollapse */ | ||
/** | ||
* @nocollapse | ||
*/ | ||
BaseResponseOptions.ctorParameters = () => []; | ||
@@ -894,3 +902,5 @@ | ||
]; | ||
/** @nocollapse */ | ||
/** | ||
* @nocollapse | ||
*/ | ||
BrowserJsonp.ctorParameters = () => []; | ||
@@ -1030,3 +1040,5 @@ | ||
]; | ||
/** @nocollapse */ | ||
/** | ||
* @nocollapse | ||
*/ | ||
JSONPBackend_.ctorParameters = () => [ | ||
@@ -1264,3 +1276,5 @@ { type: BrowserJsonp, }, | ||
]; | ||
/** @nocollapse */ | ||
/** | ||
* @nocollapse | ||
*/ | ||
XHRBackend.ctorParameters = () => [ | ||
@@ -1459,3 +1473,5 @@ { type: BrowserXhr, }, | ||
]; | ||
/** @nocollapse */ | ||
/** | ||
* @nocollapse | ||
*/ | ||
BaseRequestOptions.ctorParameters = () => []; | ||
@@ -1802,3 +1818,5 @@ | ||
]; | ||
/** @nocollapse */ | ||
/** | ||
* @nocollapse | ||
*/ | ||
Http.ctorParameters = () => [ | ||
@@ -1857,3 +1875,5 @@ { type: ConnectionBackend, }, | ||
]; | ||
/** @nocollapse */ | ||
/** | ||
* @nocollapse | ||
*/ | ||
Jsonp.ctorParameters = () => [ | ||
@@ -1907,3 +1927,5 @@ { type: ConnectionBackend, }, | ||
]; | ||
/** @nocollapse */ | ||
/** | ||
* @nocollapse | ||
*/ | ||
HttpModule.ctorParameters = () => []; | ||
@@ -1930,10 +1952,13 @@ /** | ||
]; | ||
/** @nocollapse */ | ||
/** | ||
* @nocollapse | ||
*/ | ||
JsonpModule.ctorParameters = () => []; | ||
/** | ||
* @stable | ||
* \@stable | ||
*/ | ||
const /** @type {?} */ VERSION = new Version('4.0.0-rc.3'); | ||
const VERSION = new Version('4.0.0-rc.4'); | ||
export { BrowserXhr, JSONPBackend, JSONPConnection, CookieXSRFStrategy, XHRBackend, XHRConnection, BaseRequestOptions, RequestOptions, BaseResponseOptions, ResponseOptions, ReadyState, RequestMethod, ResponseContentType, ResponseType, Headers, Http, Jsonp, HttpModule, JsonpModule, Connection, ConnectionBackend, XSRFStrategy, Request, Response, QueryEncoder, URLSearchParams, VERSION, BrowserJsonp as ɵg, JSONPBackend_ as ɵa, Body as ɵe, _createDefaultCookieXSRFStrategy as ɵb, httpFactory as ɵc, jsonpFactory as ɵd }; | ||
export { BrowserXhr, JSONPBackend, JSONPConnection, CookieXSRFStrategy, XHRBackend, XHRConnection, BaseRequestOptions, RequestOptions, BaseResponseOptions, ResponseOptions, ReadyState, RequestMethod, ResponseContentType, ResponseType, Headers, Http, Jsonp, HttpModule, JsonpModule, Connection, ConnectionBackend, XSRFStrategy, Request, Response, QueryEncoder, URLSearchParams, VERSION, BrowserJsonp as ɵg, JSONPBackend_ as ɵa, Body as ɵf, _createDefaultCookieXSRFStrategy as ɵb, httpFactory as ɵc, jsonpFactory as ɵd }; | ||
//# sourceMappingURL=http.js.map |
/** | ||
* @license Angular v4.0.0-rc.3 | ||
* @license Angular v4.0.0-rc.4 | ||
* (c) 2010-2017 Google, Inc. https://angular.io/ | ||
@@ -216,1 +216,2 @@ * License: MIT | ||
export { MockConnection, MockBackend }; | ||
//# sourceMappingURL=testing.es5.js.map |
/** | ||
* @license Angular v4.0.0-rc.3 | ||
* @license Angular v4.0.0-rc.4 | ||
* (c) 2010-2017 Google, Inc. https://angular.io/ | ||
@@ -214,2 +214,3 @@ * License: MIT | ||
export { MockConnection, MockBackend }; | ||
export { MockConnection, MockBackend }; | ||
//# sourceMappingURL=testing.js.map |
/** | ||
* @license Angular v4.0.0-rc.3 | ||
* @license Angular v4.0.0-rc.4 | ||
* (c) 2010-2017 Google, Inc. https://angular.io/ | ||
@@ -220,2 +220,3 @@ * License: MIT | ||
})); | ||
})); | ||
//# sourceMappingURL=http-testing.umd.js.map |
/** | ||
* @license Angular v4.0.0-rc.3 | ||
* @license Angular v4.0.0-rc.4 | ||
* (c) 2010-2017 Google, Inc. https://angular.io/ | ||
* License: MIT | ||
*/ | ||
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports,require("@angular/core"),require("@angular/http"),require("rxjs/ReplaySubject"),require("rxjs/Subject"),require("rxjs/operator/take")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/http","rxjs/ReplaySubject","rxjs/Subject","rxjs/operator/take"],factory):factory((global.ng=global.ng||{},global.ng.http=global.ng.http||{},global.ng.http.testing=global.ng.http.testing||{}),global.ng.core,global.ng.http,global.Rx,global.Rx,global.Rx.Observable.prototype)}(this,function(exports,_angular_core,_angular_http,rxjs_ReplaySubject,rxjs_Subject,rxjs_operator_take){"use strict";var MockConnection=function(){function MockConnection(req){this.response=rxjs_operator_take.take.call(new rxjs_ReplaySubject.ReplaySubject(1),1),this.readyState=_angular_http.ReadyState.Open,this.request=req}return MockConnection.prototype.mockRespond=function(res){if(this.readyState===_angular_http.ReadyState.Done||this.readyState===_angular_http.ReadyState.Cancelled)throw new Error("Connection has already been resolved");this.readyState=_angular_http.ReadyState.Done,this.response.next(res),this.response.complete()},MockConnection.prototype.mockDownload=function(res){},MockConnection.prototype.mockError=function(err){this.readyState=_angular_http.ReadyState.Done,this.response.error(err)},MockConnection}(),MockBackend=function(){function MockBackend(){var _this=this;this.connectionsArray=[],this.connections=new rxjs_Subject.Subject,this.connections.subscribe(function(connection){return _this.connectionsArray.push(connection)}),this.pendingConnections=new rxjs_Subject.Subject}return MockBackend.prototype.verifyNoPendingRequests=function(){var pending=0;if(this.pendingConnections.subscribe(function(c){return pending++}),pending>0)throw new Error(pending+" pending connections to be resolved")},MockBackend.prototype.resolveAllConnections=function(){this.connections.subscribe(function(c){return c.readyState=4})},MockBackend.prototype.createConnection=function(req){if(!(req&&req instanceof _angular_http.Request))throw new Error("createConnection requires an instance of Request, got "+req);var connection=new MockConnection(req);return this.connections.next(connection),connection},MockBackend}();MockBackend.decorators=[{type:_angular_core.Injectable}],MockBackend.ctorParameters=function(){return[]},exports.MockConnection=MockConnection,exports.MockBackend=MockBackend}); | ||
!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?factory(exports,require("@angular/core"),require("@angular/http"),require("rxjs/ReplaySubject"),require("rxjs/Subject"),require("rxjs/operator/take")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@angular/http","rxjs/ReplaySubject","rxjs/Subject","rxjs/operator/take"],factory):factory((global.ng=global.ng||{},global.ng.http=global.ng.http||{},global.ng.http.testing=global.ng.http.testing||{}),global.ng.core,global.ng.http,global.Rx,global.Rx,global.Rx.Observable.prototype)}(this,function(exports,_angular_core,_angular_http,rxjs_ReplaySubject,rxjs_Subject,rxjs_operator_take){"use strict";var MockConnection=function(){function MockConnection(req){this.response=rxjs_operator_take.take.call(new rxjs_ReplaySubject.ReplaySubject(1),1),this.readyState=_angular_http.ReadyState.Open,this.request=req}return MockConnection.prototype.mockRespond=function(res){if(this.readyState===_angular_http.ReadyState.Done||this.readyState===_angular_http.ReadyState.Cancelled)throw new Error("Connection has already been resolved");this.readyState=_angular_http.ReadyState.Done,this.response.next(res),this.response.complete()},MockConnection.prototype.mockDownload=function(res){},MockConnection.prototype.mockError=function(err){this.readyState=_angular_http.ReadyState.Done,this.response.error(err)},MockConnection}(),MockBackend=function(){function MockBackend(){var _this=this;this.connectionsArray=[],this.connections=new rxjs_Subject.Subject,this.connections.subscribe(function(connection){return _this.connectionsArray.push(connection)}),this.pendingConnections=new rxjs_Subject.Subject}return MockBackend.prototype.verifyNoPendingRequests=function(){var pending=0;if(this.pendingConnections.subscribe(function(c){return pending++}),pending>0)throw new Error(pending+" pending connections to be resolved")},MockBackend.prototype.resolveAllConnections=function(){this.connections.subscribe(function(c){return c.readyState=4})},MockBackend.prototype.createConnection=function(req){if(!(req&&req instanceof _angular_http.Request))throw new Error("createConnection requires an instance of Request, got "+req);var connection=new MockConnection(req);return this.connections.next(connection),connection},MockBackend}();MockBackend.decorators=[{type:_angular_core.Injectable}],MockBackend.ctorParameters=function(){return[]},exports.MockConnection=MockConnection,exports.MockBackend=MockBackend}); | ||
//# sourceMappingURL=http-testing.umd.min.js.map |
/** | ||
* @license Angular v4.0.0-rc.3 | ||
* @license Angular v4.0.0-rc.4 | ||
* (c) 2010-2017 Google, Inc. https://angular.io/ | ||
@@ -22,2 +22,3 @@ * License: MIT | ||
*/ | ||
var ConnectionBackend=function(){function ConnectionBackend(){}return ConnectionBackend.prototype.createConnection=function(request){},ConnectionBackend}(),Connection=function(){function Connection(){}return Connection}(),XSRFStrategy=function(){function XSRFStrategy(){}return XSRFStrategy.prototype.configureRequest=function(req){},XSRFStrategy}(),isSuccess=function(status){return status>=200&&status<300},QueryEncoder=function(){function QueryEncoder(){}return QueryEncoder.prototype.encodeKey=function(k){return standardEncoding(k)},QueryEncoder.prototype.encodeValue=function(v){return standardEncoding(v)},QueryEncoder}(),URLSearchParams=function(){function URLSearchParams(rawParams,queryEncoder){void 0===rawParams&&(rawParams=""),void 0===queryEncoder&&(queryEncoder=new QueryEncoder),this.rawParams=rawParams,this.queryEncoder=queryEncoder,this.paramsMap=paramParser(rawParams)}return URLSearchParams.prototype.clone=function(){var clone=new URLSearchParams("",this.queryEncoder);return clone.appendAll(this),clone},URLSearchParams.prototype.has=function(param){return this.paramsMap.has(param)},URLSearchParams.prototype.get=function(param){var storedParam=this.paramsMap.get(param);return Array.isArray(storedParam)?storedParam[0]:null},URLSearchParams.prototype.getAll=function(param){return this.paramsMap.get(param)||[]},URLSearchParams.prototype.set=function(param,val){if(void 0===val||null===val)return void this.delete(param);var list=this.paramsMap.get(param)||[];list.length=0,list.push(val),this.paramsMap.set(param,list)},URLSearchParams.prototype.setAll=function(searchParams){var _this=this;searchParams.paramsMap.forEach(function(value,param){var list=_this.paramsMap.get(param)||[];list.length=0,list.push(value[0]),_this.paramsMap.set(param,list)})},URLSearchParams.prototype.append=function(param,val){if(void 0!==val&&null!==val){var list=this.paramsMap.get(param)||[];list.push(val),this.paramsMap.set(param,list)}},URLSearchParams.prototype.appendAll=function(searchParams){var _this=this;searchParams.paramsMap.forEach(function(value,param){for(var list=_this.paramsMap.get(param)||[],i=0;i<value.length;++i)list.push(value[i]);_this.paramsMap.set(param,list)})},URLSearchParams.prototype.replaceAll=function(searchParams){var _this=this;searchParams.paramsMap.forEach(function(value,param){var list=_this.paramsMap.get(param)||[];list.length=0;for(var i=0;i<value.length;++i)list.push(value[i]);_this.paramsMap.set(param,list)})},URLSearchParams.prototype.toString=function(){var _this=this,paramsList=[];return this.paramsMap.forEach(function(values,k){values.forEach(function(v){return paramsList.push(_this.queryEncoder.encodeKey(k)+"="+_this.queryEncoder.encodeValue(v))})}),paramsList.join("&")},URLSearchParams.prototype.delete=function(param){this.paramsMap.delete(param)},URLSearchParams}(),Body=function(){function Body(){}return Body.prototype.json=function(){return"string"==typeof this._body?JSON.parse(this._body):this._body instanceof ArrayBuffer?JSON.parse(this.text()):this._body},Body.prototype.text=function(){return this._body instanceof URLSearchParams?this._body.toString():this._body instanceof ArrayBuffer?String.fromCharCode.apply(null,new Uint16Array(this._body)):null==this._body?"":"object"==typeof this._body?JSON.stringify(this._body,null,2):this._body.toString()},Body.prototype.arrayBuffer=function(){return this._body instanceof ArrayBuffer?this._body:stringToArrayBuffer(this.text())},Body.prototype.blob=function(){if(this._body instanceof Blob)return this._body;if(this._body instanceof ArrayBuffer)return new Blob([this._body]);throw new Error("The request body isn't either a blob or an array buffer")},Body}(),Response=function(_super){function Response(responseOptions){var _this=_super.call(this)||this;return _this._body=responseOptions.body,_this.status=responseOptions.status,_this.ok=_this.status>=200&&_this.status<=299,_this.statusText=responseOptions.statusText,_this.headers=responseOptions.headers,_this.type=responseOptions.type,_this.url=responseOptions.url,_this}return __extends(Response,_super),Response.prototype.toString=function(){return"Response with status: "+this.status+" "+this.statusText+" for URL: "+this.url},Response}(Body),_nextRequestId=0,JSONP_HOME="__ng_jsonp__",_jsonpConnections=null,BrowserJsonp=function(){function BrowserJsonp(){}return BrowserJsonp.prototype.build=function(url){var node=document.createElement("script");return node.src=url,node},BrowserJsonp.prototype.nextRequestID=function(){return"__req"+_nextRequestId++},BrowserJsonp.prototype.requestCallback=function(id){return JSONP_HOME+"."+id+".finished"},BrowserJsonp.prototype.exposeConnection=function(id,connection){var connections=_getJsonpConnections();connections[id]=connection},BrowserJsonp.prototype.removeConnection=function(id){var connections=_getJsonpConnections();connections[id]=null},BrowserJsonp.prototype.send=function(node){document.body.appendChild(node)},BrowserJsonp.prototype.cleanup=function(node){node.parentNode&&node.parentNode.removeChild(node)},BrowserJsonp}();BrowserJsonp.decorators=[{type:_angular_core.Injectable}],BrowserJsonp.ctorParameters=function(){return[]};var JSONP_ERR_NO_CALLBACK="JSONP injected script did not invoke callback.",JSONP_ERR_WRONG_METHOD="JSONP requests must use GET request method.",JSONPConnection=function(){function JSONPConnection(){}return JSONPConnection.prototype.finished=function(data){},JSONPConnection}(),JSONPConnection_=function(_super){function JSONPConnection_(req,_dom,baseResponseOptions){var _this=_super.call(this)||this;if(_this._dom=_dom,_this.baseResponseOptions=baseResponseOptions,_this._finished=!1,req.method!==RequestMethod.Get)throw new TypeError(JSONP_ERR_WRONG_METHOD);return _this.request=req,_this.response=new rxjs_Observable.Observable(function(responseObserver){_this.readyState=ReadyState.Loading;var id=_this._id=_dom.nextRequestID();_dom.exposeConnection(id,_this);var callback=_dom.requestCallback(_this._id),url=req.url;url.indexOf("=JSONP_CALLBACK&")>-1?url=url.replace("=JSONP_CALLBACK&","="+callback+"&"):url.lastIndexOf("=JSONP_CALLBACK")===url.length-"=JSONP_CALLBACK".length&&(url=url.substring(0,url.length-"=JSONP_CALLBACK".length)+("="+callback));var script=_this._script=_dom.build(url),onLoad=function(event){if(_this.readyState!==ReadyState.Cancelled){if(_this.readyState=ReadyState.Done,_dom.cleanup(script),!_this._finished){var responseOptions_1=new ResponseOptions({body:JSONP_ERR_NO_CALLBACK,type:ResponseType.Error,url:url});return baseResponseOptions&&(responseOptions_1=baseResponseOptions.merge(responseOptions_1)),void responseObserver.error(new Response(responseOptions_1))}var responseOptions=new ResponseOptions({body:_this._responseData,url:url});_this.baseResponseOptions&&(responseOptions=_this.baseResponseOptions.merge(responseOptions)),responseObserver.next(new Response(responseOptions)),responseObserver.complete()}},onError=function(error){if(_this.readyState!==ReadyState.Cancelled){_this.readyState=ReadyState.Done,_dom.cleanup(script);var responseOptions=new ResponseOptions({body:error.message,type:ResponseType.Error});baseResponseOptions&&(responseOptions=baseResponseOptions.merge(responseOptions)),responseObserver.error(new Response(responseOptions))}};return script.addEventListener("load",onLoad),script.addEventListener("error",onError),_dom.send(script),function(){_this.readyState=ReadyState.Cancelled,script.removeEventListener("load",onLoad),script.removeEventListener("error",onError),_this._dom.cleanup(script)}}),_this}return __extends(JSONPConnection_,_super),JSONPConnection_.prototype.finished=function(data){this._finished=!0,this._dom.removeConnection(this._id),this.readyState!==ReadyState.Cancelled&&(this._responseData=data)},JSONPConnection_}(JSONPConnection),JSONPBackend=function(_super){function JSONPBackend(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(JSONPBackend,_super),JSONPBackend}(ConnectionBackend),JSONPBackend_=function(_super){function JSONPBackend_(_browserJSONP,_baseResponseOptions){var _this=_super.call(this)||this;return _this._browserJSONP=_browserJSONP,_this._baseResponseOptions=_baseResponseOptions,_this}return __extends(JSONPBackend_,_super),JSONPBackend_.prototype.createConnection=function(request){return new JSONPConnection_(request,this._browserJSONP,this._baseResponseOptions)},JSONPBackend_}(JSONPBackend);JSONPBackend_.decorators=[{type:_angular_core.Injectable}],JSONPBackend_.ctorParameters=function(){return[{type:BrowserJsonp},{type:ResponseOptions}]};var XSSI_PREFIX=/^\)\]\}',?\n/,XHRConnection=function(){function XHRConnection(req,browserXHR,baseResponseOptions){var _this=this;this.request=req,this.response=new rxjs_Observable.Observable(function(responseObserver){var _xhr=browserXHR.build();_xhr.open(RequestMethod[req.method].toUpperCase(),req.url),null!=req.withCredentials&&(_xhr.withCredentials=req.withCredentials);var onLoad=function(){var status=1223===_xhr.status?204:_xhr.status,body=null;204!==status&&(body="undefined"==typeof _xhr.response?_xhr.responseText:_xhr.response,"string"==typeof body&&(body=body.replace(XSSI_PREFIX,""))),0===status&&(status=body?200:0);var headers=Headers.fromResponseHeaderString(_xhr.getAllResponseHeaders()),url=getResponseURL(_xhr)||req.url,statusText=_xhr.statusText||"OK",responseOptions=new ResponseOptions({body:body,status:status,headers:headers,statusText:statusText,url:url});null!=baseResponseOptions&&(responseOptions=baseResponseOptions.merge(responseOptions));var response=new Response(responseOptions);return response.ok=isSuccess(status),response.ok?(responseObserver.next(response),void responseObserver.complete()):void responseObserver.error(response)},onError=function(err){var responseOptions=new ResponseOptions({body:err,type:ResponseType.Error,status:_xhr.status,statusText:_xhr.statusText});null!=baseResponseOptions&&(responseOptions=baseResponseOptions.merge(responseOptions)),responseObserver.error(new Response(responseOptions))};if(_this.setDetectedContentType(req,_xhr),null==req.headers&&(req.headers=new Headers),req.headers.has("Accept")||req.headers.append("Accept","application/json, text/plain, */*"),req.headers.forEach(function(values,name){return _xhr.setRequestHeader(name,values.join(","))}),null!=req.responseType&&null!=_xhr.responseType)switch(req.responseType){case ResponseContentType.ArrayBuffer:_xhr.responseType="arraybuffer";break;case ResponseContentType.Json:_xhr.responseType="json";break;case ResponseContentType.Text:_xhr.responseType="text";break;case ResponseContentType.Blob:_xhr.responseType="blob";break;default:throw new Error("The selected responseType is not supported")}return _xhr.addEventListener("load",onLoad),_xhr.addEventListener("error",onError),_xhr.send(_this.request.getBody()),function(){_xhr.removeEventListener("load",onLoad),_xhr.removeEventListener("error",onError),_xhr.abort()}})}return XHRConnection.prototype.setDetectedContentType=function(req,_xhr){if(null==req.headers||null==req.headers.get("Content-Type"))switch(req.contentType){case ContentType.NONE:break;case ContentType.JSON:_xhr.setRequestHeader("content-type","application/json");break;case ContentType.FORM:_xhr.setRequestHeader("content-type","application/x-www-form-urlencoded;charset=UTF-8");break;case ContentType.TEXT:_xhr.setRequestHeader("content-type","text/plain");break;case ContentType.BLOB:var blob=req.blob();blob.type&&_xhr.setRequestHeader("content-type",blob.type)}},XHRConnection}(),CookieXSRFStrategy=function(){function CookieXSRFStrategy(_cookieName,_headerName){void 0===_cookieName&&(_cookieName="XSRF-TOKEN"),void 0===_headerName&&(_headerName="X-XSRF-TOKEN"),this._cookieName=_cookieName,this._headerName=_headerName}return CookieXSRFStrategy.prototype.configureRequest=function(req){var xsrfToken=_angular_platformBrowser.ɵgetDOM().getCookie(this._cookieName);xsrfToken&&req.headers.set(this._headerName,xsrfToken)},CookieXSRFStrategy}(),XHRBackend=function(){function XHRBackend(_browserXHR,_baseResponseOptions,_xsrfStrategy){this._browserXHR=_browserXHR,this._baseResponseOptions=_baseResponseOptions,this._xsrfStrategy=_xsrfStrategy}return XHRBackend.prototype.createConnection=function(request){return this._xsrfStrategy.configureRequest(request),new XHRConnection(request,this._browserXHR,this._baseResponseOptions)},XHRBackend}();XHRBackend.decorators=[{type:_angular_core.Injectable}],XHRBackend.ctorParameters=function(){return[{type:BrowserXhr},{type:ResponseOptions},{type:XSRFStrategy}]};var RequestOptions=function(){function RequestOptions(_a){var _b=void 0===_a?{}:_a,method=_b.method,headers=_b.headers,body=_b.body,url=_b.url,search=_b.search,params=_b.params,withCredentials=_b.withCredentials,responseType=_b.responseType;this.method=null!=method?normalizeMethodName(method):null,this.headers=null!=headers?headers:null,this.body=null!=body?body:null,this.url=null!=url?url:null,this.params=this._mergeSearchParams(params||search),this.withCredentials=null!=withCredentials?withCredentials:null,this.responseType=null!=responseType?responseType:null}return Object.defineProperty(RequestOptions.prototype,"search",{get:function(){return this.params},set:function(params){this.params=params},enumerable:!0,configurable:!0}),RequestOptions.prototype.merge=function(options){return new RequestOptions({method:options&&null!=options.method?options.method:this.method,headers:options&&null!=options.headers?options.headers:new Headers(this.headers),body:options&&null!=options.body?options.body:this.body,url:options&&null!=options.url?options.url:this.url,params:options&&this._mergeSearchParams(options.params||options.search),withCredentials:options&&null!=options.withCredentials?options.withCredentials:this.withCredentials,responseType:options&&null!=options.responseType?options.responseType:this.responseType})},RequestOptions.prototype._mergeSearchParams=function(params){return params?params instanceof URLSearchParams?params.clone():"string"==typeof params?new URLSearchParams(params):this._parseParams(params):this.params},RequestOptions.prototype._parseParams=function(objParams){var _this=this;void 0===objParams&&(objParams={});var params=new URLSearchParams;return Object.keys(objParams).forEach(function(key){var value=objParams[key];Array.isArray(value)?value.forEach(function(item){return _this._appendParam(key,item,params)}):_this._appendParam(key,value,params)}),params},RequestOptions.prototype._appendParam=function(key,value,params){"string"!=typeof value&&(value=JSON.stringify(value)),params.append(key,value)},RequestOptions}(),BaseRequestOptions=function(_super){function BaseRequestOptions(){return _super.call(this,{method:RequestMethod.Get,headers:new Headers})||this}return __extends(BaseRequestOptions,_super),BaseRequestOptions}(RequestOptions);BaseRequestOptions.decorators=[{type:_angular_core.Injectable}],BaseRequestOptions.ctorParameters=function(){return[]};var Request=function(_super){function Request(requestOptions){var _this=_super.call(this)||this,url=requestOptions.url;if(_this.url=requestOptions.url,requestOptions.params){var params=requestOptions.params.toString();if(params.length>0){var prefix="?";_this.url.indexOf("?")!=-1&&(prefix="&"==_this.url[_this.url.length-1]?"":"&"),_this.url=url+prefix+params}}return _this._body=requestOptions.body,_this.method=normalizeMethodName(requestOptions.method),_this.headers=new Headers(requestOptions.headers),_this.contentType=_this.detectContentType(),_this.withCredentials=requestOptions.withCredentials,_this.responseType=requestOptions.responseType,_this}return __extends(Request,_super),Request.prototype.detectContentType=function(){switch(this.headers.get("content-type")){case"application/json":return ContentType.JSON;case"application/x-www-form-urlencoded":return ContentType.FORM;case"multipart/form-data":return ContentType.FORM_DATA;case"text/plain":case"text/html":return ContentType.TEXT;case"application/octet-stream":return this._body instanceof ArrayBuffer$1?ContentType.ARRAY_BUFFER:ContentType.BLOB;default:return this.detectContentTypeFromBody()}},Request.prototype.detectContentTypeFromBody=function(){return null==this._body?ContentType.NONE:this._body instanceof URLSearchParams?ContentType.FORM:this._body instanceof FormData?ContentType.FORM_DATA:this._body instanceof Blob$1?ContentType.BLOB:this._body instanceof ArrayBuffer$1?ContentType.ARRAY_BUFFER:this._body&&"object"==typeof this._body?ContentType.JSON:ContentType.TEXT},Request.prototype.getBody=function(){switch(this.contentType){case ContentType.JSON:return this.text();case ContentType.FORM:return this.text();case ContentType.FORM_DATA:return this._body;case ContentType.TEXT:return this.text();case ContentType.BLOB:return this.blob();case ContentType.ARRAY_BUFFER:return this.arrayBuffer();default:return null}},Request}(Body),noop=function(){},w="object"==typeof window?window:noop,FormData=w.FormData||noop,Blob$1=w.Blob||noop,ArrayBuffer$1=w.ArrayBuffer||noop,Http=function(){function Http(_backend,_defaultOptions){this._backend=_backend,this._defaultOptions=_defaultOptions}return Http.prototype.request=function(url,options){var responseObservable;if("string"==typeof url)responseObservable=httpRequest(this._backend,new Request(mergeOptions(this._defaultOptions,options,RequestMethod.Get,url)));else{if(!(url instanceof Request))throw new Error("First argument must be a url string or Request instance.");responseObservable=httpRequest(this._backend,url)}return responseObservable},Http.prototype.get=function(url,options){return this.request(new Request(mergeOptions(this._defaultOptions,options,RequestMethod.Get,url)))},Http.prototype.post=function(url,body,options){return this.request(new Request(mergeOptions(this._defaultOptions.merge(new RequestOptions({body:body})),options,RequestMethod.Post,url)))},Http.prototype.put=function(url,body,options){return this.request(new Request(mergeOptions(this._defaultOptions.merge(new RequestOptions({body:body})),options,RequestMethod.Put,url)))},Http.prototype.delete=function(url,options){return this.request(new Request(mergeOptions(this._defaultOptions,options,RequestMethod.Delete,url)))},Http.prototype.patch=function(url,body,options){return this.request(new Request(mergeOptions(this._defaultOptions.merge(new RequestOptions({body:body})),options,RequestMethod.Patch,url)))},Http.prototype.head=function(url,options){return this.request(new Request(mergeOptions(this._defaultOptions,options,RequestMethod.Head,url)))},Http.prototype.options=function(url,options){return this.request(new Request(mergeOptions(this._defaultOptions,options,RequestMethod.Options,url)))},Http}();Http.decorators=[{type:_angular_core.Injectable}],Http.ctorParameters=function(){return[{type:ConnectionBackend},{type:RequestOptions}]};var Jsonp=function(_super){function Jsonp(backend,defaultOptions){return _super.call(this,backend,defaultOptions)||this}return __extends(Jsonp,_super),Jsonp.prototype.request=function(url,options){var responseObservable;if("string"==typeof url&&(url=new Request(mergeOptions(this._defaultOptions,options,RequestMethod.Get,url))),!(url instanceof Request))throw new Error("First argument must be a url string or Request instance.");if(url.method!==RequestMethod.Get)throw new Error("JSONP requests must use GET request method.");return responseObservable=httpRequest(this._backend,url)},Jsonp}(Http);Jsonp.decorators=[{type:_angular_core.Injectable}],Jsonp.ctorParameters=function(){return[{type:ConnectionBackend},{type:RequestOptions}]};var HttpModule=function(){function HttpModule(){}return HttpModule}();HttpModule.decorators=[{type:_angular_core.NgModule,args:[{providers:[{provide:Http,useFactory:httpFactory,deps:[XHRBackend,RequestOptions]},BrowserXhr,{provide:RequestOptions,useClass:BaseRequestOptions},{provide:ResponseOptions,useClass:BaseResponseOptions},XHRBackend,{provide:XSRFStrategy,useFactory:_createDefaultCookieXSRFStrategy}]}]}],HttpModule.ctorParameters=function(){return[]};var JsonpModule=function(){function JsonpModule(){}return JsonpModule}();JsonpModule.decorators=[{type:_angular_core.NgModule,args:[{providers:[{provide:Jsonp,useFactory:jsonpFactory,deps:[JSONPBackend,RequestOptions]},BrowserJsonp,{provide:RequestOptions,useClass:BaseRequestOptions},{provide:ResponseOptions,useClass:BaseResponseOptions},{provide:JSONPBackend,useClass:JSONPBackend_}]}]}],JsonpModule.ctorParameters=function(){return[]};var VERSION=new _angular_core.Version("4.0.0-rc.3");exports.BrowserXhr=BrowserXhr,exports.JSONPBackend=JSONPBackend,exports.JSONPConnection=JSONPConnection,exports.CookieXSRFStrategy=CookieXSRFStrategy,exports.XHRBackend=XHRBackend,exports.XHRConnection=XHRConnection,exports.BaseRequestOptions=BaseRequestOptions,exports.RequestOptions=RequestOptions,exports.BaseResponseOptions=BaseResponseOptions,exports.ResponseOptions=ResponseOptions,exports.ReadyState=ReadyState,exports.RequestMethod=RequestMethod,exports.ResponseContentType=ResponseContentType,exports.ResponseType=ResponseType,exports.Headers=Headers,exports.Http=Http,exports.Jsonp=Jsonp,exports.HttpModule=HttpModule,exports.JsonpModule=JsonpModule,exports.Connection=Connection,exports.ConnectionBackend=ConnectionBackend,exports.XSRFStrategy=XSRFStrategy,exports.Request=Request,exports.Response=Response,exports.QueryEncoder=QueryEncoder,exports.URLSearchParams=URLSearchParams,exports.VERSION=VERSION,exports.ɵg=BrowserJsonp,exports.ɵa=JSONPBackend_,exports.ɵe=Body,exports.ɵb=_createDefaultCookieXSRFStrategy,exports.ɵc=httpFactory,exports.ɵd=jsonpFactory}); | ||
var ConnectionBackend=function(){function ConnectionBackend(){}return ConnectionBackend.prototype.createConnection=function(request){},ConnectionBackend}(),Connection=function(){function Connection(){}return Connection}(),XSRFStrategy=function(){function XSRFStrategy(){}return XSRFStrategy.prototype.configureRequest=function(req){},XSRFStrategy}(),isSuccess=function(status){return status>=200&&status<300},QueryEncoder=function(){function QueryEncoder(){}return QueryEncoder.prototype.encodeKey=function(k){return standardEncoding(k)},QueryEncoder.prototype.encodeValue=function(v){return standardEncoding(v)},QueryEncoder}(),URLSearchParams=function(){function URLSearchParams(rawParams,queryEncoder){void 0===rawParams&&(rawParams=""),void 0===queryEncoder&&(queryEncoder=new QueryEncoder),this.rawParams=rawParams,this.queryEncoder=queryEncoder,this.paramsMap=paramParser(rawParams)}return URLSearchParams.prototype.clone=function(){var clone=new URLSearchParams("",this.queryEncoder);return clone.appendAll(this),clone},URLSearchParams.prototype.has=function(param){return this.paramsMap.has(param)},URLSearchParams.prototype.get=function(param){var storedParam=this.paramsMap.get(param);return Array.isArray(storedParam)?storedParam[0]:null},URLSearchParams.prototype.getAll=function(param){return this.paramsMap.get(param)||[]},URLSearchParams.prototype.set=function(param,val){if(void 0===val||null===val)return void this.delete(param);var list=this.paramsMap.get(param)||[];list.length=0,list.push(val),this.paramsMap.set(param,list)},URLSearchParams.prototype.setAll=function(searchParams){var _this=this;searchParams.paramsMap.forEach(function(value,param){var list=_this.paramsMap.get(param)||[];list.length=0,list.push(value[0]),_this.paramsMap.set(param,list)})},URLSearchParams.prototype.append=function(param,val){if(void 0!==val&&null!==val){var list=this.paramsMap.get(param)||[];list.push(val),this.paramsMap.set(param,list)}},URLSearchParams.prototype.appendAll=function(searchParams){var _this=this;searchParams.paramsMap.forEach(function(value,param){for(var list=_this.paramsMap.get(param)||[],i=0;i<value.length;++i)list.push(value[i]);_this.paramsMap.set(param,list)})},URLSearchParams.prototype.replaceAll=function(searchParams){var _this=this;searchParams.paramsMap.forEach(function(value,param){var list=_this.paramsMap.get(param)||[];list.length=0;for(var i=0;i<value.length;++i)list.push(value[i]);_this.paramsMap.set(param,list)})},URLSearchParams.prototype.toString=function(){var _this=this,paramsList=[];return this.paramsMap.forEach(function(values,k){values.forEach(function(v){return paramsList.push(_this.queryEncoder.encodeKey(k)+"="+_this.queryEncoder.encodeValue(v))})}),paramsList.join("&")},URLSearchParams.prototype.delete=function(param){this.paramsMap.delete(param)},URLSearchParams}(),Body=function(){function Body(){}return Body.prototype.json=function(){return"string"==typeof this._body?JSON.parse(this._body):this._body instanceof ArrayBuffer?JSON.parse(this.text()):this._body},Body.prototype.text=function(){return this._body instanceof URLSearchParams?this._body.toString():this._body instanceof ArrayBuffer?String.fromCharCode.apply(null,new Uint16Array(this._body)):null==this._body?"":"object"==typeof this._body?JSON.stringify(this._body,null,2):this._body.toString()},Body.prototype.arrayBuffer=function(){return this._body instanceof ArrayBuffer?this._body:stringToArrayBuffer(this.text())},Body.prototype.blob=function(){if(this._body instanceof Blob)return this._body;if(this._body instanceof ArrayBuffer)return new Blob([this._body]);throw new Error("The request body isn't either a blob or an array buffer")},Body}(),Response=function(_super){function Response(responseOptions){var _this=_super.call(this)||this;return _this._body=responseOptions.body,_this.status=responseOptions.status,_this.ok=_this.status>=200&&_this.status<=299,_this.statusText=responseOptions.statusText,_this.headers=responseOptions.headers,_this.type=responseOptions.type,_this.url=responseOptions.url,_this}return __extends(Response,_super),Response.prototype.toString=function(){return"Response with status: "+this.status+" "+this.statusText+" for URL: "+this.url},Response}(Body),_nextRequestId=0,JSONP_HOME="__ng_jsonp__",_jsonpConnections=null,BrowserJsonp=function(){function BrowserJsonp(){}return BrowserJsonp.prototype.build=function(url){var node=document.createElement("script");return node.src=url,node},BrowserJsonp.prototype.nextRequestID=function(){return"__req"+_nextRequestId++},BrowserJsonp.prototype.requestCallback=function(id){return JSONP_HOME+"."+id+".finished"},BrowserJsonp.prototype.exposeConnection=function(id,connection){var connections=_getJsonpConnections();connections[id]=connection},BrowserJsonp.prototype.removeConnection=function(id){var connections=_getJsonpConnections();connections[id]=null},BrowserJsonp.prototype.send=function(node){document.body.appendChild(node)},BrowserJsonp.prototype.cleanup=function(node){node.parentNode&&node.parentNode.removeChild(node)},BrowserJsonp}();BrowserJsonp.decorators=[{type:_angular_core.Injectable}],BrowserJsonp.ctorParameters=function(){return[]};var JSONP_ERR_NO_CALLBACK="JSONP injected script did not invoke callback.",JSONP_ERR_WRONG_METHOD="JSONP requests must use GET request method.",JSONPConnection=function(){function JSONPConnection(){}return JSONPConnection.prototype.finished=function(data){},JSONPConnection}(),JSONPConnection_=function(_super){function JSONPConnection_(req,_dom,baseResponseOptions){var _this=_super.call(this)||this;if(_this._dom=_dom,_this.baseResponseOptions=baseResponseOptions,_this._finished=!1,req.method!==RequestMethod.Get)throw new TypeError(JSONP_ERR_WRONG_METHOD);return _this.request=req,_this.response=new rxjs_Observable.Observable(function(responseObserver){_this.readyState=ReadyState.Loading;var id=_this._id=_dom.nextRequestID();_dom.exposeConnection(id,_this);var callback=_dom.requestCallback(_this._id),url=req.url;url.indexOf("=JSONP_CALLBACK&")>-1?url=url.replace("=JSONP_CALLBACK&","="+callback+"&"):url.lastIndexOf("=JSONP_CALLBACK")===url.length-"=JSONP_CALLBACK".length&&(url=url.substring(0,url.length-"=JSONP_CALLBACK".length)+("="+callback));var script=_this._script=_dom.build(url),onLoad=function(event){if(_this.readyState!==ReadyState.Cancelled){if(_this.readyState=ReadyState.Done,_dom.cleanup(script),!_this._finished){var responseOptions_1=new ResponseOptions({body:JSONP_ERR_NO_CALLBACK,type:ResponseType.Error,url:url});return baseResponseOptions&&(responseOptions_1=baseResponseOptions.merge(responseOptions_1)),void responseObserver.error(new Response(responseOptions_1))}var responseOptions=new ResponseOptions({body:_this._responseData,url:url});_this.baseResponseOptions&&(responseOptions=_this.baseResponseOptions.merge(responseOptions)),responseObserver.next(new Response(responseOptions)),responseObserver.complete()}},onError=function(error){if(_this.readyState!==ReadyState.Cancelled){_this.readyState=ReadyState.Done,_dom.cleanup(script);var responseOptions=new ResponseOptions({body:error.message,type:ResponseType.Error});baseResponseOptions&&(responseOptions=baseResponseOptions.merge(responseOptions)),responseObserver.error(new Response(responseOptions))}};return script.addEventListener("load",onLoad),script.addEventListener("error",onError),_dom.send(script),function(){_this.readyState=ReadyState.Cancelled,script.removeEventListener("load",onLoad),script.removeEventListener("error",onError),_this._dom.cleanup(script)}}),_this}return __extends(JSONPConnection_,_super),JSONPConnection_.prototype.finished=function(data){this._finished=!0,this._dom.removeConnection(this._id),this.readyState!==ReadyState.Cancelled&&(this._responseData=data)},JSONPConnection_}(JSONPConnection),JSONPBackend=function(_super){function JSONPBackend(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(JSONPBackend,_super),JSONPBackend}(ConnectionBackend),JSONPBackend_=function(_super){function JSONPBackend_(_browserJSONP,_baseResponseOptions){var _this=_super.call(this)||this;return _this._browserJSONP=_browserJSONP,_this._baseResponseOptions=_baseResponseOptions,_this}return __extends(JSONPBackend_,_super),JSONPBackend_.prototype.createConnection=function(request){return new JSONPConnection_(request,this._browserJSONP,this._baseResponseOptions)},JSONPBackend_}(JSONPBackend);JSONPBackend_.decorators=[{type:_angular_core.Injectable}],JSONPBackend_.ctorParameters=function(){return[{type:BrowserJsonp},{type:ResponseOptions}]};var XSSI_PREFIX=/^\)\]\}',?\n/,XHRConnection=function(){function XHRConnection(req,browserXHR,baseResponseOptions){var _this=this;this.request=req,this.response=new rxjs_Observable.Observable(function(responseObserver){var _xhr=browserXHR.build();_xhr.open(RequestMethod[req.method].toUpperCase(),req.url),null!=req.withCredentials&&(_xhr.withCredentials=req.withCredentials);var onLoad=function(){var status=1223===_xhr.status?204:_xhr.status,body=null;204!==status&&(body="undefined"==typeof _xhr.response?_xhr.responseText:_xhr.response,"string"==typeof body&&(body=body.replace(XSSI_PREFIX,""))),0===status&&(status=body?200:0);var headers=Headers.fromResponseHeaderString(_xhr.getAllResponseHeaders()),url=getResponseURL(_xhr)||req.url,statusText=_xhr.statusText||"OK",responseOptions=new ResponseOptions({body:body,status:status,headers:headers,statusText:statusText,url:url});null!=baseResponseOptions&&(responseOptions=baseResponseOptions.merge(responseOptions));var response=new Response(responseOptions);return response.ok=isSuccess(status),response.ok?(responseObserver.next(response),void responseObserver.complete()):void responseObserver.error(response)},onError=function(err){var responseOptions=new ResponseOptions({body:err,type:ResponseType.Error,status:_xhr.status,statusText:_xhr.statusText});null!=baseResponseOptions&&(responseOptions=baseResponseOptions.merge(responseOptions)),responseObserver.error(new Response(responseOptions))};if(_this.setDetectedContentType(req,_xhr),null==req.headers&&(req.headers=new Headers),req.headers.has("Accept")||req.headers.append("Accept","application/json, text/plain, */*"),req.headers.forEach(function(values,name){return _xhr.setRequestHeader(name,values.join(","))}),null!=req.responseType&&null!=_xhr.responseType)switch(req.responseType){case ResponseContentType.ArrayBuffer:_xhr.responseType="arraybuffer";break;case ResponseContentType.Json:_xhr.responseType="json";break;case ResponseContentType.Text:_xhr.responseType="text";break;case ResponseContentType.Blob:_xhr.responseType="blob";break;default:throw new Error("The selected responseType is not supported")}return _xhr.addEventListener("load",onLoad),_xhr.addEventListener("error",onError),_xhr.send(_this.request.getBody()),function(){_xhr.removeEventListener("load",onLoad),_xhr.removeEventListener("error",onError),_xhr.abort()}})}return XHRConnection.prototype.setDetectedContentType=function(req,_xhr){if(null==req.headers||null==req.headers.get("Content-Type"))switch(req.contentType){case ContentType.NONE:break;case ContentType.JSON:_xhr.setRequestHeader("content-type","application/json");break;case ContentType.FORM:_xhr.setRequestHeader("content-type","application/x-www-form-urlencoded;charset=UTF-8");break;case ContentType.TEXT:_xhr.setRequestHeader("content-type","text/plain");break;case ContentType.BLOB:var blob=req.blob();blob.type&&_xhr.setRequestHeader("content-type",blob.type)}},XHRConnection}(),CookieXSRFStrategy=function(){function CookieXSRFStrategy(_cookieName,_headerName){void 0===_cookieName&&(_cookieName="XSRF-TOKEN"),void 0===_headerName&&(_headerName="X-XSRF-TOKEN"),this._cookieName=_cookieName,this._headerName=_headerName}return CookieXSRFStrategy.prototype.configureRequest=function(req){var xsrfToken=_angular_platformBrowser.ɵgetDOM().getCookie(this._cookieName);xsrfToken&&req.headers.set(this._headerName,xsrfToken)},CookieXSRFStrategy}(),XHRBackend=function(){function XHRBackend(_browserXHR,_baseResponseOptions,_xsrfStrategy){this._browserXHR=_browserXHR,this._baseResponseOptions=_baseResponseOptions,this._xsrfStrategy=_xsrfStrategy}return XHRBackend.prototype.createConnection=function(request){return this._xsrfStrategy.configureRequest(request),new XHRConnection(request,this._browserXHR,this._baseResponseOptions)},XHRBackend}();XHRBackend.decorators=[{type:_angular_core.Injectable}],XHRBackend.ctorParameters=function(){return[{type:BrowserXhr},{type:ResponseOptions},{type:XSRFStrategy}]};var RequestOptions=function(){function RequestOptions(_a){var _b=void 0===_a?{}:_a,method=_b.method,headers=_b.headers,body=_b.body,url=_b.url,search=_b.search,params=_b.params,withCredentials=_b.withCredentials,responseType=_b.responseType;this.method=null!=method?normalizeMethodName(method):null,this.headers=null!=headers?headers:null,this.body=null!=body?body:null,this.url=null!=url?url:null,this.params=this._mergeSearchParams(params||search),this.withCredentials=null!=withCredentials?withCredentials:null,this.responseType=null!=responseType?responseType:null}return Object.defineProperty(RequestOptions.prototype,"search",{get:function(){return this.params},set:function(params){this.params=params},enumerable:!0,configurable:!0}),RequestOptions.prototype.merge=function(options){return new RequestOptions({method:options&&null!=options.method?options.method:this.method,headers:options&&null!=options.headers?options.headers:new Headers(this.headers),body:options&&null!=options.body?options.body:this.body,url:options&&null!=options.url?options.url:this.url,params:options&&this._mergeSearchParams(options.params||options.search),withCredentials:options&&null!=options.withCredentials?options.withCredentials:this.withCredentials,responseType:options&&null!=options.responseType?options.responseType:this.responseType})},RequestOptions.prototype._mergeSearchParams=function(params){return params?params instanceof URLSearchParams?params.clone():"string"==typeof params?new URLSearchParams(params):this._parseParams(params):this.params},RequestOptions.prototype._parseParams=function(objParams){var _this=this;void 0===objParams&&(objParams={});var params=new URLSearchParams;return Object.keys(objParams).forEach(function(key){var value=objParams[key];Array.isArray(value)?value.forEach(function(item){return _this._appendParam(key,item,params)}):_this._appendParam(key,value,params)}),params},RequestOptions.prototype._appendParam=function(key,value,params){"string"!=typeof value&&(value=JSON.stringify(value)),params.append(key,value)},RequestOptions}(),BaseRequestOptions=function(_super){function BaseRequestOptions(){return _super.call(this,{method:RequestMethod.Get,headers:new Headers})||this}return __extends(BaseRequestOptions,_super),BaseRequestOptions}(RequestOptions);BaseRequestOptions.decorators=[{type:_angular_core.Injectable}],BaseRequestOptions.ctorParameters=function(){return[]};var Request=function(_super){function Request(requestOptions){var _this=_super.call(this)||this,url=requestOptions.url;if(_this.url=requestOptions.url,requestOptions.params){var params=requestOptions.params.toString();if(params.length>0){var prefix="?";_this.url.indexOf("?")!=-1&&(prefix="&"==_this.url[_this.url.length-1]?"":"&"),_this.url=url+prefix+params}}return _this._body=requestOptions.body,_this.method=normalizeMethodName(requestOptions.method),_this.headers=new Headers(requestOptions.headers),_this.contentType=_this.detectContentType(),_this.withCredentials=requestOptions.withCredentials,_this.responseType=requestOptions.responseType,_this}return __extends(Request,_super),Request.prototype.detectContentType=function(){switch(this.headers.get("content-type")){case"application/json":return ContentType.JSON;case"application/x-www-form-urlencoded":return ContentType.FORM;case"multipart/form-data":return ContentType.FORM_DATA;case"text/plain":case"text/html":return ContentType.TEXT;case"application/octet-stream":return this._body instanceof ArrayBuffer$1?ContentType.ARRAY_BUFFER:ContentType.BLOB;default:return this.detectContentTypeFromBody()}},Request.prototype.detectContentTypeFromBody=function(){return null==this._body?ContentType.NONE:this._body instanceof URLSearchParams?ContentType.FORM:this._body instanceof FormData?ContentType.FORM_DATA:this._body instanceof Blob$1?ContentType.BLOB:this._body instanceof ArrayBuffer$1?ContentType.ARRAY_BUFFER:this._body&&"object"==typeof this._body?ContentType.JSON:ContentType.TEXT},Request.prototype.getBody=function(){switch(this.contentType){case ContentType.JSON:return this.text();case ContentType.FORM:return this.text();case ContentType.FORM_DATA:return this._body;case ContentType.TEXT:return this.text();case ContentType.BLOB:return this.blob();case ContentType.ARRAY_BUFFER:return this.arrayBuffer();default:return null}},Request}(Body),noop=function(){},w="object"==typeof window?window:noop,FormData=w.FormData||noop,Blob$1=w.Blob||noop,ArrayBuffer$1=w.ArrayBuffer||noop,Http=function(){function Http(_backend,_defaultOptions){this._backend=_backend,this._defaultOptions=_defaultOptions}return Http.prototype.request=function(url,options){var responseObservable;if("string"==typeof url)responseObservable=httpRequest(this._backend,new Request(mergeOptions(this._defaultOptions,options,RequestMethod.Get,url)));else{if(!(url instanceof Request))throw new Error("First argument must be a url string or Request instance.");responseObservable=httpRequest(this._backend,url)}return responseObservable},Http.prototype.get=function(url,options){return this.request(new Request(mergeOptions(this._defaultOptions,options,RequestMethod.Get,url)))},Http.prototype.post=function(url,body,options){return this.request(new Request(mergeOptions(this._defaultOptions.merge(new RequestOptions({body:body})),options,RequestMethod.Post,url)))},Http.prototype.put=function(url,body,options){return this.request(new Request(mergeOptions(this._defaultOptions.merge(new RequestOptions({body:body})),options,RequestMethod.Put,url)))},Http.prototype.delete=function(url,options){return this.request(new Request(mergeOptions(this._defaultOptions,options,RequestMethod.Delete,url)))},Http.prototype.patch=function(url,body,options){return this.request(new Request(mergeOptions(this._defaultOptions.merge(new RequestOptions({body:body})),options,RequestMethod.Patch,url)))},Http.prototype.head=function(url,options){return this.request(new Request(mergeOptions(this._defaultOptions,options,RequestMethod.Head,url)))},Http.prototype.options=function(url,options){return this.request(new Request(mergeOptions(this._defaultOptions,options,RequestMethod.Options,url)))},Http}();Http.decorators=[{type:_angular_core.Injectable}],Http.ctorParameters=function(){return[{type:ConnectionBackend},{type:RequestOptions}]};var Jsonp=function(_super){function Jsonp(backend,defaultOptions){return _super.call(this,backend,defaultOptions)||this}return __extends(Jsonp,_super),Jsonp.prototype.request=function(url,options){var responseObservable;if("string"==typeof url&&(url=new Request(mergeOptions(this._defaultOptions,options,RequestMethod.Get,url))),!(url instanceof Request))throw new Error("First argument must be a url string or Request instance.");if(url.method!==RequestMethod.Get)throw new Error("JSONP requests must use GET request method.");return responseObservable=httpRequest(this._backend,url)},Jsonp}(Http);Jsonp.decorators=[{type:_angular_core.Injectable}],Jsonp.ctorParameters=function(){return[{type:ConnectionBackend},{type:RequestOptions}]};var HttpModule=function(){function HttpModule(){}return HttpModule}();HttpModule.decorators=[{type:_angular_core.NgModule,args:[{providers:[{provide:Http,useFactory:httpFactory,deps:[XHRBackend,RequestOptions]},BrowserXhr,{provide:RequestOptions,useClass:BaseRequestOptions},{provide:ResponseOptions,useClass:BaseResponseOptions},XHRBackend,{provide:XSRFStrategy,useFactory:_createDefaultCookieXSRFStrategy}]}]}],HttpModule.ctorParameters=function(){return[]};var JsonpModule=function(){function JsonpModule(){}return JsonpModule}();JsonpModule.decorators=[{type:_angular_core.NgModule,args:[{providers:[{provide:Jsonp,useFactory:jsonpFactory,deps:[JSONPBackend,RequestOptions]},BrowserJsonp,{provide:RequestOptions,useClass:BaseRequestOptions},{provide:ResponseOptions,useClass:BaseResponseOptions},{provide:JSONPBackend,useClass:JSONPBackend_}]}]}],JsonpModule.ctorParameters=function(){return[]};var VERSION=new _angular_core.Version("4.0.0-rc.4");exports.BrowserXhr=BrowserXhr,exports.JSONPBackend=JSONPBackend,exports.JSONPConnection=JSONPConnection,exports.CookieXSRFStrategy=CookieXSRFStrategy,exports.XHRBackend=XHRBackend,exports.XHRConnection=XHRConnection,exports.BaseRequestOptions=BaseRequestOptions,exports.RequestOptions=RequestOptions,exports.BaseResponseOptions=BaseResponseOptions,exports.ResponseOptions=ResponseOptions,exports.ReadyState=ReadyState,exports.RequestMethod=RequestMethod,exports.ResponseContentType=ResponseContentType,exports.ResponseType=ResponseType,exports.Headers=Headers,exports.Http=Http,exports.Jsonp=Jsonp,exports.HttpModule=HttpModule,exports.JsonpModule=JsonpModule,exports.Connection=Connection,exports.ConnectionBackend=ConnectionBackend,exports.XSRFStrategy=XSRFStrategy,exports.Request=Request,exports.Response=Response,exports.QueryEncoder=QueryEncoder,exports.URLSearchParams=URLSearchParams,exports.VERSION=VERSION,exports.ɵg=BrowserJsonp,exports.ɵa=JSONPBackend_,exports.ɵf=Body,exports.ɵb=_createDefaultCookieXSRFStrategy,exports.ɵc=httpFactory,exports.ɵd=jsonpFactory}); | ||
//# sourceMappingURL=http.umd.min.js.map |
{ | ||
"name": "@angular/http", | ||
"version": "4.0.0-rc.3", | ||
"version": "4.0.0-rc.4", | ||
"description": "Angular - the http service", | ||
@@ -8,3 +8,3 @@ "main": "./bundles/http.umd.js", | ||
"es2015": "./@angular/http.js", | ||
"typings": "./typings/http.d.ts", | ||
"typings": "./http.d.ts", | ||
"author": "angular", | ||
@@ -14,4 +14,4 @@ "license": "MIT", | ||
"rxjs": "^5.0.1", | ||
"@angular/core": "4.0.0-rc.3", | ||
"@angular/platform-browser": "4.0.0-rc.3" | ||
"@angular/core": "4.0.0-rc.4", | ||
"@angular/platform-browser": "4.0.0-rc.4" | ||
}, | ||
@@ -18,0 +18,0 @@ "repository": { |
{ | ||
"typings": "../typings/testing/index.d.ts", | ||
"typings": "../testing.d.ts", | ||
"main": "../bundles/http-testing.umd.js", | ||
@@ -4,0 +4,0 @@ "module": "../@angular/http/testing.es5.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
826795
48
8202