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

twitter logo ・1 min read

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…

twitter logo DISCUSS
Classic DEV Post from Jun 26

The 7 most important software design patterns

Software design patterns provide templates and tricks used to design and solve recurring software problems. Here are the 7 most important.

David Smith profile image
Systems engineer for Hub City Media, hobbyist Android dev, hobbyist game dev, and general goofball.

Sore eyes?

dev.to now has dark mode.

Go to the "misc" section of your settings and select night theme ❤️