当前位置: 代码迷 >> 综合 >> feign method GET must not have a request body.超过2个参数时报Method has too many Body parameters:
  详细解决方案

feign method GET must not have a request body.超过2个参数时报Method has too many Body parameters:

热度:64   发布时间:2023-09-19 21:30:28.0

feign使用okhttp3的Get方式请求接口时必须加@RequestParam,否则会报错feign method GET must not have a request body,name传入null值也会报错,feign的get请求使用默认的时候,也得加@RequestParam,并且得有value,否则会报另一个错,param.value empty

public Object getParamsByAppCode(@RequestParam(value = "appCode") String appCode,@RequestParam(value = "name",required=false) String name);

 

  相关解决方案