mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +03:00
Fixing issue with post data
This commit is contained in:
Vendored
+6
-3
File diff suppressed because one or more lines are too long
+5
-2
@@ -17,7 +17,10 @@ function axios(options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onerror() {
|
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 {
|
try {
|
||||||
@@ -44,7 +47,7 @@ function axios(options) {
|
|||||||
reject(e);
|
reject(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
request.send(options.data || null);
|
request.send(options.data ? JSON.stringify(options.data) : null);
|
||||||
});
|
});
|
||||||
|
|
||||||
promise.success = function (fn) {
|
promise.success = function (fn) {
|
||||||
|
|||||||
Reference in New Issue
Block a user