2015-02-15 17:33:06 -07:00
|
|
|
|
(function (globalScope) {
|
|
|
|
|
|
2015-06-30 10:21:20 -07:00
|
|
|
|
globalScope.HttpClient = {
|
2015-02-15 17:33:06 -07:00
|
|
|
|
|
2015-05-25 10:32:22 -07:00
|
|
|
|
param: function (params) {
|
2015-02-15 17:33:06 -07:00
|
|
|
|
return jQuery.param(params);
|
|
|
|
|
},
|
|
|
|
|
|
2015-06-30 10:21:20 -07:00
|
|
|
|
send: function (request) {
|
2015-05-25 10:32:22 -07:00
|
|
|
|
|
|
|
|
|
request.timeout = request.timeout || 30000;
|
2015-02-15 17:33:06 -07:00
|
|
|
|
|
2015-05-21 13:53:14 -07:00
|
|
|
|
try {
|
|
|
|
|
return jQuery.ajax(request);
|
|
|
|
|
} catch (err) {
|
|
|
|
|
var deferred = DeferredBuilder.Deferred();
|
|
|
|
|
deferred.reject();
|
|
|
|
|
return deferred.promise();
|
|
|
|
|
}
|
2015-02-15 17:33:06 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
})(window);
|