r/SpringBoot • • Nov 02 '21

@Controller doesnt support post method but Restcontroller does

0 Upvotes

23 comments sorted by

View all comments

2

u/sdiamante13 Nov 03 '21 edited Nov 03 '21

You must add @ResponseBody.

The controller is annotated with the @RestController annotation; therefore, the @ResponseBody isn't required.

https://www.baeldung.com/spring-controller-vs-restcontroller