Can Spring MVC have request parameters for an HTTP PUT method, or must I use post? Which should I use to be RESTful?

前端 未结 4 455
北海茫月
北海茫月 2020-12-25 15:02

I have a controller action I think should be an HTTP PUT, but Spring is complaining when I try and use @RequestParam in the controller action. Is request parameters not allo

4条回答
  •  我在风中等你
    2020-12-25 15:38

    I followed the recommendation in the comments and changed @RequestParam to @RequestBody and it just worked (my parameter is a String).

    I agree this is a bug in Spring because the exact same code that fails in my production environment (when using @RequestParam) works fine in localhost.

提交回复
热议问题