|
From: Steven S. <ssc...@op...> - 2014-06-16 18:28:17
|
Hi everyone,
I am trying to use an API which depends on HTTP 301 redirects.
I’ve declared my interface, e.g.
interface MyApi {
@Path("/version")
@GET
String getVersion();
}
However I cannot figure out how to avoid:
javax.ws.rs.RedirectionException: HTTP 301 Moved Permanently
at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.extractResult(ClientInvocation.java:152)
at org.jboss.resteasy.client.jaxrs.internal.proxy.extractors.BodyEntityExtractor.extractEntity(BodyEntityExtractor.java:58)
at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientInvoker.invoke(ClientInvoker.java:104)
at org.jboss.resteasy.client.jaxrs.internal.proxy.ClientProxy.invoke(ClientProxy.java:62)
It looks like the “old” proxy api (org.jboss.resteasy.client.ProxyBuilder) creates proxies that implement ResteasyClientProxy. From there, you can add a ClientInvokerModifier that calls followRedirects() on the ClientInvoker instance.
However various bits along this path are marked @Deprecated and now there is a org.jboss.resteasy.client.jaxrs.ProxyBuilder which seems to supplant this, but does not provide the same functionality to follow redirects.
How is this done now?
Thanks,
Steven
|