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了。

原文地址:https://www.cnblogs.com/vipsoft/p/14758682.html