Why SpringMVC Request method 'GET' not supported?

method = POST will work if you 'post' a form to the url /test.

if you type a url in address bar of a browser and hit enter, it's always a GET request, so you had to specify POST request.

Google for HTTP GET and HTTP POST (there are several others like PUT DELETE). They all have their own meaning.


Change

@RequestMapping(value = "/test", method = RequestMethod.POST)

To

@RequestMapping(value = "/test", method = RequestMethod.GET)

Apparently some POST requests looks like a "GET" to the server (like Heroku...)

So I use this strategy and it works for me:

@RequestMapping(value = "/salvar", method = { RequestMethod.GET, RequestMethod.POST })

I solved this error by including a get and post request in my controller: method={RequestMethod.POST, RequestMethod.GET}