Mam taki problem, gdy wysyłam zwykłego posta za pomoca ARC to rekord dodaj sie do bazy ale chciałbym to robić za pomoca formularza thymeleaf
co mam?
controller user zmapowany na /user i metode add wystawioną na posta
@RequestMapping(method = RequestMethod.POST)
public void add(@RequestBody User user) {
userRepository.save(user);
}
kawałek html
<form th:action="@{/user}" method="post">
<input type="text" name="name" />
<input type="submit" value="Submit" />
</form>
i dostaje
There was an unexpected error (type=Unsupported Media Type, status=415).
Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported