I'm writing a jQuery app that interfaces with a node.js server, so I'd like to pass JSON around everywhere.
It seems like jQuery's $.post(url, data, ...)
method sends its data in URL-encoded form. i.e, {foo: true, bar: "baz"}
becomes foo=true&bar=baz
, losing data type information.
Can I get jQuery to send the data in JSON format? Or should I just call $.post
with a pre-JSON.stringify
'd string?