2016-11-15 24 views
-3
@Override 
public Map<String, String> getHeaders() throws AuthFailureError { 
    HashMap<String, String> headers = new HashMap<String, String>(); 
    headers.put("Content-Type", "application/json"); 
    headers.put("Authorization", Auth_token); 
    headers.put("Cookie", GlobleVariables.COOKIE_VALUE + Auth_token); 
    return headers; 
} 
+0

您需要添加大量的更多信息,請。你想要做什麼,目前在做什麼? – LordWilmore

回答

1

如果您不需要與Android的兼容性< 2.3您只需將這一行代碼添加到您的onCreate活動或應用程序中。這將激活所有httpURLconnections的默認CookieManager。

CookieHandler.setDefault(new CookieManager()); 

來源:Volley ignores Cookie header request

,你可以找到詳細的解決方案Here

+0

在創建時添加應用控制器,但仍然給出狀態碼422 –

相關問題