Reputation: 1649
I have found some simillar questions, but couldn't find an answer that works for me.
The problem is when I post data from Postman, in the controller I get null values,
here is the controller :
@RestController
public class LoginPageController extends AbstractPageContoller{
@RequestMapping(value="login",method=RequestMethod.POST)
public LoginForm login(@RequestBody LoginForm loginForm) {
System.err.println(loginForm.getLogin());
return loginForm;
}
}
and here is the class that I try to send as data to the controller :
public class LoginForm{
private String login;
private String password;
//Getters and setters
}
Thanks for your help
Upvotes: 0
Views: 58
Reputation: 2616
Your input data is wrong: it should be:
{ "login" : "aaa", "password" : "aaa" }
Upvotes: 1