Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-1075

JAX-RS client shoud support redirect

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Done
    • Icon: Major Major
    • 4.0.0.Beta1, 3.5.0.CR1
    • 3.0.7.Final
    • jaxrs
    • None

      The RESTeasy implementation of the JAX-RS client library does not seem to support any handling of redirects, despite the underlying ability of Apache HttpClient to do so.

      At the very least there are these problems:

      1) There is no way to indicate that a proxy class generated via ResteasyWebTarget.proxy should follow redirects.

      2) ClientInvoker has some relevant methods but you cannot call the setter "followRedirects" particularly from a proxy and even if you could the getter seems to be totally unreferenced

      3) ApacheHttpClient4Engine explicitly forbids it with a TODO

            if (httpMethod instanceof HttpGet && false) // todo  && request.followRedirects())
            {
               HttpClientParams.setRedirecting(httpMethod.getParams(), true);
            }
            else
            {
               HttpClientParams.setRedirecting(httpMethod.getParams(), false);
            }
      

      There are multiple threads to the mailing list about this functionality and none of them seem to have any response but silence.

            rhn-support-asoldano Alessio Soldano
            stevenschlansker Steven Schlansker
            Votes:
            5 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: