I\'m using jQuery to post JSON to a Java server, but I think my JSON must be wrong. Here\'s an example of my data and how I\'m sending it:
var lookup = {
You have to use JSON.stringify:
$.ajax({
type: 'post',
data: JSON.stringify(lookup),
contentType: 'application/json',
dataType: 'json'
});
You should also specify 'application/json' as the contentType. By default jQuery will serialize objects with application/x-www-form-urlencoded (even if the contentType is application/json'). So you have to do it manually.
EDIT: Key for 'post' should be type, not method.