android - Keep cookie for all the request in my app when using volley -
i using volley in android application , use load images of time, once have download file(not images) use native httpurlconnection
instead of volley.
now want both volley , httpurlconnection
use same cookie in whole application.
is possible?
you can create own volleyrequest
class extends com.android.volley.request
. requests in app using class.
to use cookie these requests override getheaders
method , can same operation of setting cookie might doing httpurlconnection
@override public map<string, string> getheaders() throws authfailureerror { hashmap<string, string> headersmap = new hashmap<string, string>(); headersmap.put("cookie", "cookie_key=cookie_value"); return headersmap; }
Comments
Post a Comment