Пример #1
0
 @Override
 public Map<String, String> getHeaders() throws AuthFailureError {
   String cookie = LibCookieManager.getCookies();
   Log.i("kshj", "RequestWithCookie -> getHeaders() -> rawCookies: " + cookie);
   if (!TextUtils.isEmpty(cookie)) {
     HashMap<String, String> headers = new HashMap<String, String>();
     headers.put("cookie", cookie);
     return headers;
   }
   return super.getHeaders();
 }
Пример #2
0
 @Override
 protected Response<JSONObject> parseNetworkResponse(NetworkResponse response) {
   Response<JSONObject> superResponse = super.parseNetworkResponse(response);
   Map<String, String> responseHeaders = response.headers;
   if (responseHeaders != null) {
     String rawCookies = responseHeaders.get("Set-Cookie");
     if (!TextUtils.isEmpty(rawCookies)) {
       LibCookieManager.setCookieValue(rawCookies);
     }
     Log.i("kshj", "RequestWithCookie -> parseNetWorkResponse -> rawCookies: " + rawCookies);
   }
   return superResponse;
 }