Why SpringMVC Request method 'GET' not supported?

前端 未结 6 590
误落风尘
误落风尘 2020-12-01 05:34

I trying @RequestMapping(value = \"/test\", method = RequestMethod.POST) but is error

Code is

 @Controller
 public class HelloWordContr         


        
6条回答
  •  无人及你
    2020-12-01 06:05

    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.

提交回复
热议问题