- update readme

- implement response type support for browser platform
This commit is contained in:
Sefa Ilkimen
2019-06-14 00:52:27 +02:00
parent 85346e0381
commit 1fc3d6230c
2 changed files with 8 additions and 1 deletions
+5 -1
View File
@@ -101,7 +101,7 @@ function setHeaders(xhr, headers) {
}
function sendRequest(method, withData, opts, success, failure) {
var data, serializer, headers, timeout, followRedirect;
var data, serializer, headers, timeout, followRedirect, responseType;
var url = opts[0];
if (withData) {
@@ -110,10 +110,13 @@ function sendRequest(method, withData, opts, success, failure) {
headers = opts[3];
timeout = opts[4];
followRedirect = opts[5];
responseType = opts[6];
} else {
headers = opts[1];
timeout = opts[2];
followRedirect = opts[3];
responseType = opts[4];
}
var processedData = null;
@@ -152,6 +155,7 @@ function sendRequest(method, withData, opts, success, failure) {
}
xhr.timeout = timeout * 1000;
xhr.responseType = responseType;
setHeaders(xhr, headers);
xhr.onerror = xhr.ontimeout = function () {