类 Cookie
java.lang.Object
com.lark.oapi.okhttp.Cookie
An RFC 6265 Cookie.
This class doesn't support additional attributes on cookies, like Chromium's Priority=HIGH extension.
-
嵌套类概要
嵌套类 -
方法概要
修饰符和类型方法说明domain()Returns the cookie's domain.booleanlongReturns the time that this cookie expires, in the same format asSystem.currentTimeMillis().inthashCode()booleanhostOnly()Returns true if this cookie's domain should be interpreted as a single host name, or false if it should be interpreted as a pattern.booleanhttpOnly()Returns true if this cookie should be limited to only HTTP APIs.booleanReturns true if this cookie should be included on a request tourl.name()Returns a non-empty string with this cookie's name.static CookieAttempt to parse aSet-CookieHTTP header valuesetCookieas a cookie.Returns all of the cookies from a set of HTTP response headers.path()Returns this cookie's path.booleanReturns true if this cookie does not expire at the end of the current session.booleansecure()Returns true if this cookie should be limited to only HTTPS requests.toString()value()Returns a possibly-empty string with this cookie's value.
-
方法详细资料
-
parse
Attempt to parse aSet-CookieHTTP header valuesetCookieas a cookie. Returns null ifsetCookieis not a well-formed cookie. -
parseAll
Returns all of the cookies from a set of HTTP response headers. -
name
Returns a non-empty string with this cookie's name. -
value
Returns a possibly-empty string with this cookie's value. -
persistent
public boolean persistent()Returns true if this cookie does not expire at the end of the current session. -
expiresAt
public long expiresAt()Returns the time that this cookie expires, in the same format asSystem.currentTimeMillis(). This is December 31, 9999 if the cookie is not persistent, in which case it will expire at the end of the current session.This may return a value less than the current time, in which case the cookie is already expired. Webservers may return expired cookies as a mechanism to delete previously set cookies that may or may not themselves be expired.
-
hostOnly
public boolean hostOnly()Returns true if this cookie's domain should be interpreted as a single host name, or false if it should be interpreted as a pattern. This flag will be false if itsSet-Cookieheader included adomainattribute.For example, suppose the cookie's domain is
example.com. If this flag is true it matches onlyexample.com. If this flag is false it matchesexample.comand all subdomains includingapi.example.com,www.example.com, andbeta.api.example.com. -
domain
Returns the cookie's domain. IfhostOnly()returns true this is the only domain that matches this cookie; otherwise it matches this domain and all subdomains. -
path
Returns this cookie's path. This cookie matches URLs prefixed with path segments that match this path's segments. For example, if this path is/foothis cookie matches requests to/fooand/foo/bar, but not/or/football. -
httpOnly
public boolean httpOnly()Returns true if this cookie should be limited to only HTTP APIs. In web browsers this prevents the cookie from being accessible to scripts. -
secure
public boolean secure()Returns true if this cookie should be limited to only HTTPS requests. -
matches
Returns true if this cookie should be included on a request tourl. In addition to this check callers should also confirm that this cookie has not expired. -
toString
-
equals
-
hashCode
public int hashCode()
-