【问题标题】:Why Volley Send Cookie in Header Not Working Android?为什么 Volley 在标头中发送 Cookie 不起作用 Android?
【发布时间】:2016-11-15 16:52:09
【问题描述】:
@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;
}

【问题讨论】:

  • 请您添加更多信息。你想让它做什么,它目前在做什么?

标签: android cookies header android-volley


【解决方案1】:

如果您不需要兼容 Android

CookieHandler.setDefault(new CookieManager());

来源:Volley ignores Cookie header request

你可以找到详细的解决方案Here

【讨论】:

  • 在创建时添加应用控制器,但仍然给出状态码 422
猜你喜欢
  • 1970-01-01
  • 2018-10-28
  • 2017-03-01
  • 2020-03-24
  • 2017-10-15
  • 2021-08-22
  • 2021-02-11
  • 2013-07-10
  • 1970-01-01
相关资源
最近更新 更多