I can use OkhttpClient
to send a GET
request to the server and get the cookie in the final response properly(the response code of which is 200 )and the cookie of which can be retrieved using addInterceptor()
.
Request-> 302(Set-cookie?
) -> 302(Set-cookie?
) -> 302(Set-cookie?
) ->200(Set-cookie√(can be get using interceptor))
(the question mark ?
means don't know how to get)
But the situation here is that there might be a series of redirects before the final response(200) is returned, the redirects carry the Set-cookie
header. Is there any way using Okhttp
to retrieve the cookies in the Set-cookie
header in every redirect
?