From 282b01092c2d43277fbd1a3bc7655f16a49b45e5 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Sun, 26 Jan 2014 15:51:58 +0000 Subject: [PATCH] Send POST body on asyncRequest --- data/js/tomahawk.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/data/js/tomahawk.js b/data/js/tomahawk.js index ad2b7ac97..730a95a85 100644 --- a/data/js/tomahawk.js +++ b/data/js/tomahawk.js @@ -36,7 +36,7 @@ if ((typeof Tomahawk === "undefined") || (Tomahawk === null)) { }; } -Tomahawk.apiVersion = "0.2.0"; +Tomahawk.apiVersion = "0.2.1"; /** * Compares versions strings @@ -283,6 +283,7 @@ Tomahawk.syncRequest = function (url, extraHeaders, options) { * - username: The username for HTTP Basic Auth * - password: The password for HTTP Basic Auth * - errorHandler: callback called if the request was not completed + * - data: body data included in POST requests */ Tomahawk.asyncRequest = function (url, callback, extraHeaders, options) { // unpack options @@ -307,7 +308,7 @@ Tomahawk.asyncRequest = function (url, callback, extraHeaders, options) { } } }; - xmlHttpRequest.send(null); + xmlHttpRequest.send(opt.data || null); }; Tomahawk.sha256 = Tomahawk.sha256 || CryptoJS.SHA256;