From 3a0439de04ae76f5eb097b224cb7d60059c547a8 Mon Sep 17 00:00:00 2001 From: Leo Horie Date: Fri, 31 Oct 2014 21:35:32 -0400 Subject: [PATCH] add error message for case of bad serialize --- mithril.js | 1 + 1 file changed, 1 insertion(+) diff --git a/mithril.js b/mithril.js index 4f5ffa35..15f3cfb4 100644 --- a/mithril.js +++ b/mithril.js @@ -885,6 +885,7 @@ Mithril = m = new function app(window, undefined) { 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) return xhr }