2
0
mirror of https://github.com/tenrok/axios.git synced 2026-05-15 11:59:42 +03:00

Fixing issue with post data

This commit is contained in:
Matt Zabriskie
2014-08-26 09:35:33 -06:00
parent 9c2528d9cc
commit 28073866a5
2 changed files with 11 additions and 5 deletions
+6 -3
View File
File diff suppressed because one or more lines are too long
+5 -2
View File
@@ -17,7 +17,10 @@ function axios(options) {
}
function onerror() {
reject(new Error('Can\'t connect to ' + JSON.stringify(options.url)));
reject(
parse(request.responseText) ||
new Error('Can\'t connect to ' + JSON.stringify(options.url))
);
}
try {
@@ -44,7 +47,7 @@ function axios(options) {
reject(e);
}
request.send(options.data || null);
request.send(options.data ? JSON.stringify(options.data) : null);
});
promise.success = function (fn) {