Request method‘POST‘ not supported 解决: @RequestMapping(method = RequestMethod.GET,value = "/risk/queryAll") @FeignClient(value = "risk-service", configuration = RiskClientFallbackFactory.class) public interface RiskClient { @RequestMapping(method = RequestMethod.GET,value = "/risk/queryAll"...
"status":405,"error":"Method Not Allowed","path":"/order/getOrderNo"}]
at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:189) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) at org.springframework.web.servlet...
public class FeignRequestInterceptor implements RequestInterceptor { @Override public void apply(RequestTemplate requestTemplate) { log.warn("请求url={},method={},headers={},body={}", requestTemplate.url(), requestTemplate.method(), requestTemplate.headers(), new String(requestTemplate.body()) );...
2022-07-04 11:13:30.110 WARN 66016 --- [nio-9091-exec-6] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' not supported] 通过意思信息我们可以发现,我们的GET请求被当成了POST请求,如果不加默认的注解,Feign则...
targetType.getSimpleName()); //这里限制了targetType类对象指代的类或接口最多只能继承一个接口 checkState(targetType.getInterfaces().length <= 1, "Only single inheritance supported: %s", targetType.getSimpleName()); final Map<String, MethodMetadata> result = new LinkedHashMap<String, MethodMetadata...
2022-07-04 11:13:30.110 WARN 66016 --- [nio-9091-exec-6] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved [org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' not supported] 1. 通过意思信息我们可以发现,我们的GET请求被当成了POST请求,如果不加默认的注解,Fe...
feign.FeignException$MethodNotAllowed: [405] during [GET] to [http://api-02-application/getObjParam] [PersonClient#getObjParam(String)]: [{"timestamp":"2020-09-16T05:35:22.853+0000","status":405,"error":"Method Not Allowed","message":"Request method 'POST' not supported","path":"...
上面的类图看出,SynchronousMethodHandler这个类的invoke方法是上面的代理中反射触发的方法,我们来看一下: public Object invoke(Object[] argv) throws Throwable { //RequestTemplate封装RequestTemplate RequestTemplate template = buildTemplateFromArgs.create(argv); Retryer retryer = this.retryer.clone(); while ...
();//LoadBalancerFeignClientClient client=getOptional(context,Client.class);if(client!=null){if(clientinstanceofLoadBalancerFeignClient){// not load balancing because we have a url,// but ribbon is on the classpath, so unwrap//OKHttpClientclient=((LoadBalancerFeignClient)client).getDelegate()...