类 ForestCookieHeader

java.lang.Object
com.dtflys.forest.http.SimpleHeader
com.dtflys.forest.http.ForestCookieHeader
所有已实现的接口:
ForestHeader<SimpleHeader,String>

public class ForestCookieHeader extends SimpleHeader
Forest 请求中的 Cookie 头
从以下版本开始:
1.5.23
作者:
gongjun[dt_flys@hotmail.com]
  • 构造器详细资料

    • ForestCookieHeader

      public ForestCookieHeader(HasURL hasURL)
  • 方法详细资料

    • getCookies

      public List<ForestCookie> getCookies(String name)
      根据 Cookie 名称获取 Cookie 列表
      参数:
      name - Cookie 名称
      返回:
      ForestCookie对象实例
    • getCookieMap

      public Map<String,ForestCookie> getCookieMap(String path)
      根据 path 获取 Cookie 哈希表
      参数:
      path - 路径
      返回:
      哈希表, key: 字符串, value: ForestCookie对象实例
    • getCookie

      public ForestCookie getCookie(String name)
      根据 Cookie 名称获取单个 Cookie
      参数:
      name - Cookie 名称
      返回:
      ForestCookie对象实例
    • getCookie

      public ForestCookie getCookie(String path, String name)
      根据 Path 和 Cookie 名称获取单个 Cookie
      参数:
      path - 路径
      name - Cookie 名称
      返回:
      ForestCookie对象实例
    • removeCookie

      public ForestCookie removeCookie(ForestCookie cookie)
      删除 Cookie
      参数:
      cookie - ForestCookie对象实例
      返回:
      ForestCookie对象实例
    • addCookie

      public boolean addCookie(ForestCookie cookie)
      添加Cookie头
      参数:
      cookie - ForestCookie对象实例
      返回:
      true: 添加Cookie成功,false: 添加Cookie失败
      从以下版本开始:
      1.5.23
    • addCookie

      public boolean addCookie(ForestCookie cookie, boolean strict)
      添加Cookie头
      参数:
      cookie - ForestCookie对象实例
      strict - 是否严格匹配(只有匹配域名,以及没过期的 Cookie 才能添加)
      返回:
      true: 添加Cookie成功,false: 添加Cookie失败
      从以下版本开始:
      1.5.25
    • addCookies

      public void addCookies(List<ForestCookie> cookies)
      批量添加Cookie头
      参数:
      cookies - ForestCookie对象列表
      从以下版本开始:
      1.5.23
    • getCookies

      public List<ForestCookie> getCookies()
      获取所有 Cookie 列表
      返回:
      ForestCookie对象列表
    • getValue

      public String getValue()
      从接口复制的说明: ForestHeader
      获取请求头的值
      指定者:
      getValue 在接口中 ForestHeader<SimpleHeader,String>
      覆盖:
      getValue 在类中 SimpleHeader
      返回:
      请求头的值