DEV Community

David Smith
David Smith

Posted on

Passing Retrofit a client with FollowRedirect(false), but call is returning a 200 instead of expected 302

I have an app that is trying to get the auth code from a header. I have Retrofit configured as so:

private val moshi = Moshi.Builder().add(KotlinJsonAdapterFactory()).build()
private val httpClient = OkHttpClient.Builder().run {
    followRedirects(false)
    followSslRedirects(false)
    build()
}
private val retrofit = Retrofit.Builder().run {
    baseUrl(BASE_URL)
    client(httpClient)
    addConverterFactory(MoshiConverterFactory.create(moshi))
    build()
}

In the interface…

Top comments (0)