无法在Feign中使用POST方法

我试图为stockfigher游戏api编写包装器,只是为了了解假装是如何工作的,我有第一个POST方法的问题:

@RequestMapping(method = RequestMethod.POST, value = "/venues/KHEX/stocks/LMC/orders")
void newOrderForAStock(String order);

每当我尝试调用它时,我都会遇到异常:

Caused by: feign.RetryableException: cannot retry due to redirection, in streaming mode executing POST https://api.stockfighter.io/ob/api//venues/KHEX/stocks/LMC/orders
at feign.FeignException.errorExecuting(FeignException.java:56)
at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:97)
at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:71)
at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:94)
at com.sun.proxy.$Proxy50.newOrderForAStock(Unknown Source)
at karolik.michal.stockfighter.runner.TestIt.buyFirst(TestIt.java:45)
at karolik.michal.stockfighter.runner.TestIt.runIt(TestIt.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:349)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:300)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:133)
... 22 common frames omitted

有没有办法调整它?

最佳答案 您的订单需要是@RequestParam(“order”)字符串顺序

点赞