-
-
Save twiceyuan/909331b966a63cf9538985e697e2c148 to your computer and use it in GitHub Desktop.
[OkHttp Cookie 处理] Handle Cookies easily with Retrofit/OkHttp #Android
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Somewhere you create a new OkHttpClient and use it on all your requests. | |
*/ | |
OkHttpClient okHttpClient = new OkHttpClient(); | |
okHttpClient.interceptors().add(new AddCookiesInterceptor()); | |
okHttpClient.interceptors().add(new ReceivedCookiesInterceptor()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment