Reputation: 151
I am trying to do post request in play framework. Below is my sample code
routes.conf:
POST /movies/add controllers.MovieController.add()
controller:
public Result add(Request request) {
System.out.println("BODY:::"+request.body().toString());
return ok();
}
I get below error
not enough arguments for method add: (x$1: play.mvc.Http.Request)play.mvc.Result.
What am i missing here to make this work?
Upvotes: 0
Views: 642
Reputation: 110
Your add method is expecting a request object but its not in the route. I based this on the post example in the link below.
POST /movies/add controllers.MovieController.add(request: Request)
Upvotes: 1