public class QueryStringEncoder extends Object
QueryStringEncoder
encoder = newQueryStringEncoder
("/hello"); encoder.addParam("recipient", "world"); assert encoder.toString().equals("/hello?recipient=world");
QueryStringDecoder
Constructor and Description |
---|
QueryStringEncoder(String uri)
Creates a new encoder that encodes a URI that starts with the specified
path string.
|
QueryStringEncoder(String uri,
Charset charset)
Creates a new encoder that encodes a URI that starts with the specified
path string in the specified charset.
|
QueryStringEncoder(String uri,
String charset)
Deprecated.
Use
QueryStringEncoder(String, Charset) instead. |
Modifier and Type | Method and Description |
---|---|
void |
addParam(String name,
String value)
Adds a parameter with the specified name and value to this encoder.
|
String |
toString()
Returns the URL-encoded URI which was created from the path string
specified in the constructor and the parameters added by
addParam(String, String) method. |
URI |
toUri()
Returns the URL-encoded URI object which was created from the path string
specified in the constructor and the parameters added by
addParam(String, String) method. |
public QueryStringEncoder(String uri)
public QueryStringEncoder(String uri, Charset charset)
@Deprecated public QueryStringEncoder(String uri, String charset)
QueryStringEncoder(String, Charset)
instead.public void addParam(String name, String value)
public URI toUri() throws URISyntaxException
addParam(String, String)
method.URISyntaxException
public String toString()
addParam(String, String)
method.Copyright © 2008-2015 The Netty Project. All Rights Reserved.