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

JAX-RS client should support redirect

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Duplicate
    • Major
    • None
    • 3.6.3.Final
    • jaxrs
    • None

    Description

      I still have trouble making a simple jax-rs client follow redirects.
      The `ClientProperties.FOLLOW_REDIRECTS` property is explicitely set to true.
      The json body is expected to be parsed by the jax-rs client by using the `get(Pojo.class)` construct.
      The request is made on a `/api/endpoint` endpoint, the server responds with a 301 `Location /api/endpoint/`.

      My code hits org.jboss.resteasy.client.jaxrs.internal.ClientInvocation#extractResult which contains (https://github.com/resteasy/Resteasy/blob/cf8e9f971a0875a6de8e8e3479732b1699f6709b/resteasy-client/src/main/java/org/jboss/resteasy/client/jaxrs/internal/ClientInvocation.java#L230):

      ```
      if (status >= 300 && status < 400)
      throw new RedirectionException(response);
      ```

      This exception is not caught.

      Attachments

        Issue Links

          Activity

            People

              weinanli Weinan Li
              cghislai charles ghislain (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: