public final class ClientCookieEncoder extends Object
Note that multiple cookies are supposed to be sent at once in a single "Cookie" header.
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.
|
protected void |
validateCookie(String name,
String value) |
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
- specified the cookiepublic String encode(Cookie... cookies)
cookies
- some cookiespublic String encode(Iterable<? extends Cookie> cookies)
cookies
- some cookies