美文网首页
SpringMVC中@RequestBody使用的坑

SpringMVC中@RequestBody使用的坑

作者: HachiLin | 来源:发表于2023-10-27 23:07 被阅读0次
  • 在GET请求中,不能使用@RequestBody,但是可以使用@RequestParam;
  • 在POST请求中,可以使用@RequestBody和@RequestParam,使用@RequestBody必须保证参数转化配置统一;
  • @RequestParam一般用来处理Content-Type为application/x-www-from-urlencoded编码的内容。
  • @RequestBody处理HttpEntity传递过来的数据,一般用来处理Content-Type为application/x-www-from-urlencoded编码的内容。

相关文章

网友评论

      本文标题:SpringMVC中@RequestBody使用的坑

      本文链接:https://www.haomeiwen.com/subject/jcppidtx.html