I am trying to retrieve params from a POST request with the Java Play Framework (2.3.x).
Here is my post request:
$.post(
"/some/endpoint",
{
"thingId": 12345,
"otherThingId": 1234
},
function (data) { /* Do some stuff. */ },
"json"
);
And this is in my controller:
public static Result SomeEndpoint() {
DynamicForm params = Form.form().bindFromRequest();
System.out.println(params.get("thingId"));
System.out.println(params.get("otherThingId"));
}
Unfortunately, I never get any of the params I am trying to send. Anybody know what I am doing wrong?
Thanks!