0

following is my code

@RestController
@RequestMapping(value="/users")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping(value ="/registration",method = RequestMethod.POST)
    public void addUser(@RequestBody @Valid UserDTO userDTO) {
        System.out.println("from Post");
        userService.saveUser(userDTO);
    }

    @RequestMapping(value = "/dashboard/getUserDetails", method = RequestMethod.GET)
    public List<UserDTO> getUsers() {
        System.out.println("inside controller");
        return userService.getUsers();
    }}

in the above code when i am trying to hit get endpoint its working and when i am trying to hit POST endpoint it is throwing 404.

please help me in solving the problem

emoleumassi
  • 4,881
  • 13
  • 67
  • 93
Billa
  • 13
  • 1
  • 6

0 Answers0