diff --git a/promise.js b/promise.js index 2097271..7fb7382 100644 --- a/promise.js +++ b/promise.js @@ -147,6 +147,10 @@ } xhr.setRequestHeader('Content-type', content_type); + if (content_type==="application/json") + { + payload = JSON.stringify(data) + } function onTimeout() { xhr.abort();