diff --git a/archive/v0.1.4/mithril.min.zip b/archive/v0.1.4/mithril.min.zip index 3dede029..74333ec8 100644 Binary files a/archive/v0.1.4/mithril.min.zip and b/archive/v0.1.4/mithril.min.zip differ diff --git a/archive/v0.1.4/mithril.request.html b/archive/v0.1.4/mithril.request.html index 728c8f68..eeeb33ed 100644 --- a/archive/v0.1.4/mithril.request.html +++ b/archive/v0.1.4/mithril.request.html @@ -213,6 +213,14 @@ var users = User.list(); url: "myfile.txt", deserialize: function(value) {return value;} }); +
The config option can be used to arbitrarily configure the native XMLHttpRequest instance and to access properties that would not be accessible otherwise.
The example below show how to configure a request where the server expects requests to have a Content-Type: application/json header
var xhrConfig = function(xhr) {
+ xhr.setRequestHeader("Content-Type", "application/json");
+}
+
+m.request({method: "POST", url: "/foo", config: xhrConfig});