jellyfin-web/dashboard-ui/apiclient/ajax.js

24 lines
515 B
JavaScript
Raw Normal View History

(function (globalScope) {
2015-06-30 10:21:20 -07:00
globalScope.HttpClient = {
2015-05-25 10:32:22 -07:00
param: function (params) {
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-05-21 13:53:14 -07:00
try {
return jQuery.ajax(request);
} catch (err) {
var deferred = DeferredBuilder.Deferred();
deferred.reject();
return deferred.promise();
}
}
};
})(window);