HeaderMap Method has too many Body parameters

在 Feign 方法里面添加 Header 报 Method has too many Body parameters

    @PostMapping(value = "/sendsms")
    String sendSMS(@HeaderMap Map<String, Object> headerParam, @RequestBody Map<String, Object> bodyParam);

 

修改代码如下

    @PostMapping(value = "/message/sendsms")
    String sendSMS(@RequestHeader Map<String, Object> headerParam, @RequestBody Map<String, Object> bodyParam);

因为 RequestBody 是 Spring 的。HeaderMap 是 Feign的,HeaderMap改成 RequestHeader 都用 Spring 的就OK了。

posted @ 2021-05-12 10:21  VipSoft  阅读(625)  评论(0编辑  收藏  举报