problem description
the backend can only receive get requests, and the data received by post is null
.the environmental background of the problems and what methods you have tried
take a look at the break point. The value passed by the post request is null
tested with postman. I thought it was a problem with the testing software. Then I wrote a form form test, and the result is the same.
cannot receive data using post.
related codes
/ / Please paste the code text below (do not replace the code with pictures)
@RequestMapping(value = "login.do", method = RequestMethod.GET)
@ResponseBody
public ServerResponse<User> login(String username,String password, HttpSession session){
ServerResponse<User> response = iUserService.login(username,password);
if(response.isSuccess()){
session.setAttribute(Const.CURRENT_USER,response.getData());
}
return response;
}
what result do you expect? What is the error message actually seen?
username and password should be able to receive the value passed by the front end
, but actually not. The value is null