
cloud
hi_link
java软件设计
展开
-
feign GET请求不支持对象传参的坑
问题@GetMapping("/getByParam")String hello(Student student) throws Exception;如上,feign调用报错500。解决方法:增加@SpringQueryMap@GetMapping("/getByParam")String hello(@SpringQueryMap Student student) throws Exception;原创 2021-05-10 16:28:35 · 703 阅读 · 0 评论 -
利用Feign发get请求遇到的坑
问题@RequestMapping(value="/test",method = RquestMethod.GET)Result getA(String id);如上,调用该方法报错请求方式post错误,请用get。原因分析feign将该get方法转为了post,导致出错。加上@RequestParam后问题解决。修改后代码如下。@RequestMapping(value="/test",method = RquestMethod.GET)Result getA(@Reque原创 2021-05-10 15:33:48 · 993 阅读 · 0 评论 -
spring cloud gateway-filter的那些事(StripPrefix、PrefixPath)
网关过滤器StripPrefix 过滤器作用: 去掉部分URL路径spring: cloud: gateway: routes: - id: bds-lbs-service uri: lb://bds-lbs-service predicates: - Path=/lbs/** filters: - StripPrefix=1如上,我们访问网关地址http://host:po原创 2021-04-20 08:49:35 · 11705 阅读 · 1 评论