Feign解决Get请求自动转化成POST的问题

ぐ巨炮叔叔 提交于 2019-11-29 20:48:52

方法1:

步骤

  • 加入Feign的配置项(调用方)
  • feign:
      httpclient:
        enabled: true
  • 加入这两个依赖(fegin接口 service-)
  • <!-- httpclient -->
    <dependency>
       <groupId>org.apache.httpcomponents</groupId>
       <artifactId>httpclient</artifactId>
       <version>4.5.9</version>
    </dependency>
    
    <!-- feign-httpclient -->
    <dependency>
       <groupId>io.github.openfeign</groupId>
       <artifactId>feign-httpclient</artifactId>
       <version>10.2.3</version>
    </dependency>
  • 但是会存在参数传递不过去的问题

方法2:

增加注解 @SpringQueryMap

@GetMapping("/demo-proxy/demo/selectDemoTestList")
public List<DemoTest> selectDemoTestList(@SpringQueryMap DemoTest demoTest);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!