public class QueryStringEncoder extends Object
QueryStringEncoderencoder = 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.
|
| 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 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–2025 The Netty Project. All rights reserved.