原 Method Not Allowed
版权声明:本文为博主原创文章,请尊重他人的劳动成果,转载请附上原文出处链接和本声明。
本文链接:https://www.91mszl.com/zhangwuji/article/details/1047
跨微服务调用时报错:Method Not Allowed","message":"Request method 'POST' not supported","path":"/**/**"
报错如下:
@GetMapping("/user/selectUser")
List<user>
selectUser (@RequestBody List<user> userList);
报错原因:
@RequestBody要用 @PostMapping方式;
修改之后:
@PostMapping("/user/selectUser")
List<user> selectUser(@RequestBody List<user> userList);
总结:
@RequestBody --> @PostMapping
@RequestParam ,@PathVariable --> @GetMapping
2019-08-23 14:11:29 阅读(1356)
名师出品,必属精品 https://www.91mszl.com
博主信息