mithril.js icon indicating copy to clipboard operation
mithril.js copied to clipboard

m.request - data: args or {data: args}

Open pelonpelon opened this issue 11 years ago • 1 comments

components.md && piggybacking-requests-in-a-widgety-world.html

    return m.request({method: "GET", url: "/api/contact", data: data})

mithril.components.md:

   things: m.request({method: "GET", url: "/api/things/", {data: args}}) //slice the data in some way

mithril.request.md has no mention of data: at all although I seem to remember it being used in other parts of the documentation.

From the source it looks like data just gets parsed into URL parameters. I'm not clear as to which use is correct and under what circumstances it should be used.

pelonpelon avatar Apr 30 '15 01:04 pelonpelon

Oops, that's a typo in the component page. Fixed

lhorie avatar Apr 30 '15 01:04 lhorie