public final class ClientCookieEncoder extends CookieEncoder
Cookie#rawValue()
will be used.
Otherwise, Cookie.value()
will be used unquoted.
Note that multiple cookies are supposed to be sent at once in a single "Cookie" header.
// 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
|
static ClientCookieEncoder |
STRICT
Strict encoder that validates that name and value chars are in the valid scope
defined in RFC6265
|
Modifier and Type | Method and Description |
---|---|
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)
specified
- the cookiepublic String encode(Cookie... cookies)
cookies
- some cookiesCopyright © 2008-2016 The Netty Project. All Rights Reserved.