>PROBLEM
web service returns with 404
>SOLUTION
If you have already checked the protocol, then check if the @ResponseBody annotation is missing.
- BEFORE:
@PostMapping(value = {"/reset/{token}"})
public ResponseDTO resetPassword(HttpServletRequest request, @PathVariable String token) {
ResponseDTO dto = request(request, token);
dto.setData("hello there!");
return dto;
}
- AFTER:
@PostMapping(value = {"/reset/{token}"})
@ResponseBody
public ResponseDTO resetPassword(HttpServletRequest request, @PathVariable String token) {
ResponseDTO dto = request(request, token);
dto.setData("hello there!");
return dto;
}
>ENV
spring boot 2
java 17
No comments:
Post a Comment