how to get param in method post spring mvc?

后端 未结 4 1887
执笔经年
执笔经年 2020-11-29 23:59

I\'m using spring mvc. And I can\'t get param from url when method = post. But when I change method to GET, so I can get all param.

This is my form:

         


        
4条回答
  •  情深已故
    2020-11-30 00:33

    You should use @RequestParam on those resources with method = RequestMethod.GET

    In order to post parameters, you must send them as the request body. A body like JSON or another data representation would depending on your implementation (I mean, consume and produce MediaType).

    Typically, multipart/form-data is used to upload files.

提交回复
热议问题