Home Okhttp: get cookie from Set-cookie header in a series of redirects
Reply: 0

Okhttp: get cookie from Set-cookie header in a series of redirects

kolibreath
1#
kolibreath Published in 2017-12-06 02:00:23Z

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?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.30232 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO