1

I would like to know how should I handle 302 using Retrofit 1.9 with connection url 2.5 and OkHttp 2.5 (old project). I need to 'grab' header and check if there is redirect url - if yes, request was successful.

As I understand from this post: How do you prevent Retrofit from automatically following a 302 is that I should setRedirectStrategy. Is setRedirectStrategy the best apprach for this? Current Adapter look like this:

new RestAdapter.Builder()
                .setClient(getFullyConfiguredClient(environment))
                .setLogLevel(environment.getLogLevel()).
                        setRequestInterceptor(requestInterceptor)
                .setEndpoint(createEndpoint(environment.getRequestEndpointUrl()))
                .build()

getFullyConfiguredClient()

is returning an retrofit.client.Client instance

Community
  • 1
  • 1
Unii
  • 1,587
  • 15
  • 33

0 Answers0