首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SpringCloud + OpenFeign :无法使用@RequestAttribute调用其他应用程序

SpringCloud + OpenFeign :无法使用@RequestAttribute调用其他应用程序
EN

Stack Overflow用户
提问于 2020-08-04 15:48:09
回答 1查看 39关注 0票数 0

我有一个Spring Cloud Feign客户端映射,定义如下:

代码语言:javascript
复制
@RequestMapping(method = RequestMethod.GET, value = "/list")
List<PojoVM> getList(@RequestAttribute (name = "cifNumber") String cifNumber);

当我打电话的时候

代码语言:javascript
复制
public List<PojoVM> getList() {
  return client.getList("100001");
}

其他应用程序将此OpenFeign应用程序api调用作为POST接收,而不是GET

是否还有其他方式来使用@RequestAtrribute?

EN

回答 1

Stack Overflow用户

发布于 2020-08-04 16:18:24

我不知道注释@RequestAttribute。您应该改用@RequestParam (或@PathVariable)。

代码语言:javascript
复制
@RequestMapping(method = RequestMethod.GET, value = "/list")
List<PojoVM> getList(@RequestParam(name="cifNumber") String cifNumber);
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63242328

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档