I am not sure this involves how play parses json or if it is a pure jQuery/JS problem.
I am having trouble sending json object as part of a json cotent-Type POST request.
JavaScript/jQuery
var data1 = ({ rating : 3 }) ; // does not work
var data2 = '{ "rating" : 3}'; // works fine
$.ajax( { url : "/rate", data : data1 , contentType: "application/json", success: function(json){ console.log("Ajax Return :"+json); } } );
When I use data1 in place of data2 I get a 400 (Bad Request)
routes
POST /rate controllers.Application.rate
The action code is like this
def rate = Action(parse.json) { request => Ok(toJson( Map("success":1) )); }
thanks
Arun