public final class ClientCookieEncoder extends CookieEncoder
// ExampleHttpRequest
req = ...; res.setHeader("Cookie",ClientCookieEncoder
.encode("JSESSIONID", "1234"));
ClientCookieDecoder
Modifier and Type | Field and Description |
---|---|
static ClientCookieEncoder |
LAX
Lax instance that doesn't validate name and value, and (for methods that accept multiple cookies) keeps
cookies in the order in which they were given.
|
static ClientCookieEncoder |
STRICT
Strict encoder that validates that name and value chars are in the valid scope and (for methods that accept
multiple cookies) sorts cookies into order of decreasing path length, as specified in RFC6265.
|
strict
Modifier and Type | Method and Description |
---|---|
String |
encode(Collection<? extends Cookie> cookies)
Encodes the specified cookies into a single Cookie header value.
|
String |
encode(Cookie... cookies)
Encodes the specified cookies into a single Cookie header value.
|
String |
encode(Cookie cookie)
Encodes the specified cookie into a Cookie header value.
|
String |
encode(Iterable<? extends Cookie> cookies)
Encodes the specified cookies into a single Cookie header value.
|
String |
encode(String name,
String value)
Encodes the specified cookie into a Cookie header value.
|
validateCookie
public static final ClientCookieEncoder STRICT
public static final ClientCookieEncoder LAX
public String encode(String name, String value)
name
- the cookie namevalue
- the cookie valuepublic String encode(Cookie cookie)
cookie
- the specified cookiepublic String encode(Cookie... cookies)
cookies
- some cookiespublic String encode(Collection<? extends Cookie> cookies)
cookies
- some cookiesCopyright © 2008–2017 The Netty Project. All rights reserved.