Trying to get JQuery to post JSON to a server:
$.ajax({
url: \"/path/to/url\",
type: \"POST\",
dataType: \"json\",
contentType: \"json\",
You could use json2.js:
data: JSON.stringify({"foo": "bar"})
Datatype is for returned data. Contenttype is not applicable, see here
It can only send strings, I use JSON.stringify
on my created javascript objects, in your case you could just manually code the string.
You will also need to access the string on server side, for that if you are using java I can recommened google's gson