您的位置:首页 > 编程语言 > Java开发

springboot路径请求出现Request method 'POST' not supported的解决方法

2020-02-03 01:30 5362 查看

1.若在springboot请求(post)中出现以下情况的解决办法

2.可以在controller中配置请求的路径中支持**@RequestMapping(value = “/PostRequest”, method = {RequestMethod.POST})**即可


3.参考的解决此问题的网址,链接:https://blog.csdn.net/xingkaichun/article/details/92579001

springboot 同时支持get,post请求写法

@RequestMapping(value = “/GetPostRequest”, method = {RequestMethod.GET,RequestMethod.POST})

springboot 支持get请求写法

@RequestMapping(value = “/GetRequest”, method = {RequestMethod.GET})

或者

@GetMapping("/GetRequest")

springboot 支持post请求写法

@RequestMapping(value = “/PostRequest”, method = {RequestMethod.POST})

或者

@PostMapping("/PostRequest")

  • 点赞
  • 收藏
  • 分享
  • 文章举报
知了知乐 发布了6 篇原创文章 · 获赞 0 · 访问量 1031 私信 关注
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐