diff --git a/chrome/content/zotero/xpcom/http.js b/chrome/content/zotero/xpcom/http.js index 28e2c63598..de988a2ff0 100644 --- a/chrome/content/zotero/xpcom/http.js +++ b/chrome/content/zotero/xpcom/http.js @@ -99,26 +99,31 @@ Zotero.HTTP = new function() { /** * Get a promise for a HTTP request * - * @param {String} method The method of the request ("GET", "POST", "HEAD", or "OPTIONS") - * @param {nsIURI|String} url URL to request - * @param {Object} [options] Options for HTTP request: - * @param {Zotero.CookieSandbox} [cookieSandbox] Cookie sandbox object - * @return {Promise} A promise resolved with the XMLHttpRequest object if the - * request succeeds, or rejected if the browser is offline or a non-2XX status response + * @param {String} method - The method of the request ("GET", "POST", etc.) + * @param {nsIURI|String} url - URL to request + * @param {Object} [options] Options for HTTP request: + * @param {String} [options.body] - The body of a POST request + * @param {Object} [options.headers] - Object of HTTP headers to send with the request + * @param {Boolean} [options.followRedirects = true] - Object of HTTP headers to send with the + * request + * @param {Zotero.CookieSandbox} [options.cookieSandbox] - The sandbox from which cookies should + * be taken + * @param {Boolean} [options.debug] - Log response text and status code + * @param {Boolean} [options.dontCache] - If set, specifies that the request should not be + * fulfilled from the cache + * @param {Boolean} [options.foreground] - Make a foreground request, showing + * certificate/authentication dialogs if necessary + * @param {Number} [options.logBodyLength=1024] - Length of request body to log + * @param {Number} [options.timeout] - Request timeout specified in milliseconds + * @param {Function} [options.requestObserver] - Callback to receive XMLHttpRequest after open() + * @param {String} [options.responseType] - The type of the response. See XHR 2 documentation + * for legal values + * @param {String} [options.responseCharset] - The charset the response should be interpreted as + * @param {Number[]|false} [options.successCodes] - HTTP status codes that are considered + * successful, or FALSE to allow all + * @param {Zotero.CookieSandbox} [options.cookieSandbox] - Cookie sandbox object + * @return {Promise} - A promise resolved with the XMLHttpRequest object if the + * request 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). */ this.request = Zotero.Promise.coroutine(function* (method, url, options = {}) {