I hosted a Springboot app on Heroku. Build and deploy works perfectly fine. However, I see this error whenever I want to access the method. There was an unexpected error (type=Bad Request, status=400).
It works perfectly fine on Postman if I use loclhost but throws error using the Heroku's app.
Here is what the controller looks like. I am guessing this is where the issue is coming from.
.
..
@Slf4j
@RestController
@RequestMapping("/api/v1/")
public class UserController {
@Autowired
UserService userService;
@RequestMapping(value = "/addUser")
public ResponseEntity<AddResponseDTO> addUser(@RequestBody AddUserDTO addUserDTO) throws ApplicationException {
AddResponseDTO response = userService.saveUser(addUserDTO);
return ResponseEntity.ok(response);
}
}
What do you think I can I do make the api work on Heroku?