Feign 客户端调用(到 http 服务)在运行时调用时从 GET 请求转换为 POST
Feign Client Call(to a http service) is converted from GET request to POST when the call is made in runtime
我试图通过 feign 客户端调用 http GET 服务,但我看到请求在调用之前被转换为 POST。
没有 header Get 调用工作正常(我的意思是给出 401 而不是 404),header 内容是我尝试调用的 http 服务所期望的,因此无法删除 header.
@FeignClient(name="commonservice")
@Path("/company/service/module")
public interface getCaseInfo{
@GET
@Path("/endpointURI/{pathparam}")
public ResponseObject getCaseDetails(@PathParam("pathparam") String param, @RequestHeader Map<String,String> header) throws exception
}
/也试过@HeaderParam 注解/
假装客户端调用必须作为 GET 请求使用 Headers
我能够通过对我拥有的每个自定义 header 参数使用 @headerparam 来解决问题。 但如果我使用:
"@Headerparam/@HeaderMap 地图headers"
更新代码:
public ResponseObject getCaseDetails(@PathParam("pathparam") 字符串参数,@HeaderParam("custom_header1") 字符串custom_header1,@HeaderParam("custom_header2") 字符串custom_header2)
如果有人能告诉我为什么 map 不起作用,那就太好了!
我试图通过 feign 客户端调用 http GET 服务,但我看到请求在调用之前被转换为 POST。
没有 header Get 调用工作正常(我的意思是给出 401 而不是 404),header 内容是我尝试调用的 http 服务所期望的,因此无法删除 header.
@FeignClient(name="commonservice")
@Path("/company/service/module")
public interface getCaseInfo{
@GET
@Path("/endpointURI/{pathparam}")
public ResponseObject getCaseDetails(@PathParam("pathparam") String param, @RequestHeader Map<String,String> header) throws exception
}
/也试过@HeaderParam 注解/
假装客户端调用必须作为 GET 请求使用 Headers
我能够通过对我拥有的每个自定义 header 参数使用 @headerparam 来解决问题。 但如果我使用: "@Headerparam/@HeaderMap 地图headers"
更新代码: public ResponseObject getCaseDetails(@PathParam("pathparam") 字符串参数,@HeaderParam("custom_header1") 字符串custom_header1,@HeaderParam("custom_header2") 字符串custom_header2)
如果有人能告诉我为什么 map 不起作用,那就太好了!