i have same endpoint for both get and put, so both were working fine. but suddenly after some time i see that put method stops working. My controller class looks correct, with separate mappings for GET and PUT requests to retrieve and update user details, respectively. Tool used for testing : Postman
Below is my Controller class
@RestController @RequestMapping(path = "/api/users") public class UserRestController { @Autowired UserService userService; @GetMapping("/{userId}") public ResponseEntity getUserById(@PathVariable Long userId) { return userService.getUserById(userId); } @PutMapping("/{userId}") public ResponseEntity updateUser(@PathVariable Long userId, @RequestBody UserDto updateUserDto){ return userService.updateUser(userId, updateUserDto); } }

it was working some time before but suddenly it stopped working. is this because i discarded the changes in below file before moving it to staging area?? i am not sure but i think after discarding this only it started giving this error, or is there any other reason.
git checkout -- target/classes/com/clothingstore/userservice/controller/UserRestController.class
i am using inteliJ
Источник: https://stackoverflow.com/questions/780 ... ported-405
Мобильная версия