I have a problem sending json data to Play Controller.
seach.scala.html
$.ajax({ type : "POST", dataType: 'json', data: { 'filter': "John Portella" }, url : "@routes.Search.findPag()", success: function(data){ console.log(data); } }); return false;
Controller: POST /find/findPag Search.findPag()
public static Result findPag(){ JsonNode json = request().body().asJson(); return ok(); }
Debugging I get json = null. What do you think is the problem? Thanks.
source share