add error message for case of bad serialize
This commit is contained in:
parent
d8936beef2
commit
3a0439de04
1 changed files with 1 additions and 0 deletions
|
|
@ -885,6 +885,7 @@ Mithril = m = new function app(window, undefined) {
|
||||||
if (maybeXhr != null) xhr = maybeXhr
|
if (maybeXhr != null) xhr = maybeXhr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isStr(options.data) && options.data.constructor != window.FormData) throw "Request data should be either be a string or FormData. Check the `serialize` option in `m.request`"
|
||||||
xhr.send(options.method == "GET" || !options.data ? "" : options.data)
|
xhr.send(options.method == "GET" || !options.data ? "" : options.data)
|
||||||
return xhr
|
return xhr
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue