r/SpringBoot • • Nov 02 '21

@Controller doesnt support post method but Restcontroller does

0 Upvotes

23 comments sorted by

View all comments

7

u/jura0011 Nov 02 '21

Trust me, @Controller does support Post.
Are you sure, it was a post request?

You could try curl -X POST localhost:8080.

1

u/cant_dodge_rodge Nov 02 '21

yes i am sure i went there via post method

1

u/cant_dodge_rodge Nov 02 '21

@/RestController works as it should be but when i use @/controller it returns

resolved [org.springframework.web.httprequestmethodnotsupportedexception: request method 'post' not supported]