public final class ClientCookieEncoder extends Object
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 | Method and Description |
---|---|
static String |
encode(Cookie... cookies)
Encodes the specified cookies into a single Cookie header value.
|
static String |
encode(Cookie cookie)
Encodes the specified cookie into a Cookie header value.
|
static String |
encode(Iterable<Cookie> cookies)
Encodes the specified cookies into a single Cookie header value.
|
static String |
encode(String name,
String value)
Encodes the specified cookie into a Cookie header value.
|
public static String encode(String name, String value)
name
- the cookie namevalue
- the cookie valuepublic static String encode(Cookie cookie)
specified
- the cookiepublic static String encode(Cookie... cookies)
cookies
- some cookiesCopyright © 2008–2015 The Netty Project. All rights reserved.