Rename Zotero.HTTP.promise() to Zotero.HTTP.request()

This commit is contained in:
Dan Stillman 2015-03-22 02:42:21 -04:00
parent 9c0dc327e0
commit 32a4604481

View File

@ -46,9 +46,14 @@ Zotero.HTTP = new function() {
return this.message; return this.message;
}; };
this.promise = function () {
Zotero.debug("Zotero.HTTP.promise() is deprecated -- use Zotero.HTTP.request()", 2);
return this.request.apply(this, arguments);
}
/** /**
* Get a promise for a HTTP request * Get a promise for a HTTP request
* *
* @param {String} method The method of the request ("GET", "POST", "HEAD", or "OPTIONS") * @param {String} method The method of the request ("GET", "POST", "HEAD", or "OPTIONS")
* @param {nsIURI|String} url URL to request * @param {nsIURI|String} url URL to request
* @param {Object} [options] Options for HTTP request:<ul> * @param {Object} [options] Options for HTTP request:<ul>
@ -69,7 +74,7 @@ Zotero.HTTP = new function() {
* succeeds, or rejected if the browser is offline or a non-2XX status response * succeeds, or rejected if the browser is offline or a non-2XX status response
* code is received (or a code not in options.successCodes if provided). * code is received (or a code not in options.successCodes if provided).
*/ */
this.promise = function promise(method, url, options) { this.request = function (method, url, options) {
if (url instanceof Components.interfaces.nsIURI) { if (url instanceof Components.interfaces.nsIURI) {
// Don't display password in console // Don't display password in console
var dispURL = this.getDisplayURI(url).spec; var dispURL = this.getDisplayURI(url).spec;