类 MockCookie

    • 方法详细资料

      • getExpires

        @Nullable
        public ZonedDateTime getExpires()
        Get the "Expires" attribute for this cookie.
        返回:
        the "Expires" attribute for this cookie, or null if not set
        从以下版本开始:
        5.1.11
      • setSameSite

        public void setSameSite​(@Nullable
                                String sameSite)
        Set the "SameSite" attribute for this cookie.

        This limits the scope of the cookie such that it will only be attached to same-site requests if the supplied value is "Strict" or cross-site requests if the supplied value is "Lax".

        另请参阅:
        RFC6265 bis
      • getSameSite

        @Nullable
        public String getSameSite()
        Get the "SameSite" attribute for this cookie.
        返回:
        the "SameSite" attribute for this cookie, or null if not set
      • parse

        public static MockCookie parse​(String setCookieHeader)
        Factory method that parses the value of the supplied "Set-Cookie" header.
        参数:
        setCookieHeader - the "Set-Cookie" value; never null or empty
        返回:
        the created cookie