9

im trying to write wrapper for stockfigher game api, just to learn how feign works and I have issues with very first POST method:

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

whenever I try to call it, I get exception:

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 .stockfighter.runner.TestIt.buyFirst(TestIt.java:45)
at .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

is there any way to tweak it?

hi_my_name_is
  • 4,894
  • 3
  • 34
  • 50

1 Answers1

2

Your order needs to be @RequestParam("order") String order

tyrantqiao
  • 319
  • 4
  • 7