public class URLEncodedUtils extends Object
Constructor and Description |
---|
URLEncodedUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
format(Iterable<? extends NameValuePair> parameters,
char parameterSeparator,
java.nio.charset.Charset charset)
Returns a String that is suitable for use as an
application/x-www-form-urlencoded
list of parameters in an HTTP PUT or HTTP POST. |
static String |
format(Iterable<? extends NameValuePair> parameters,
java.nio.charset.Charset charset)
Returns a String that is suitable for use as an
application/x-www-form-urlencoded
list of parameters in an HTTP PUT or HTTP POST. |
static String |
formatSegments(Iterable<String> segments,
java.nio.charset.Charset charset)
Returns a string consisting of joint encoded path segments.
|
static String |
formatSegments(String... segments)
Returns a string consisting of joint encoded path segments.
|
static List<NameValuePair> |
parse(CharSequence s,
java.nio.charset.Charset charset)
Returns a list of
NameValuePair s URI query parameters. |
static List<NameValuePair> |
parse(CharSequence s,
java.nio.charset.Charset charset,
char... separators)
Returns a list of
NameValuePair s parameters. |
static List<NameValuePair> |
parse(URI uri,
java.nio.charset.Charset charset)
Returns a list of
NameValuePair s URI query parameters. |
static List<String> |
parsePathSegments(CharSequence s)
Returns a list of URI path segments.
|
static List<String> |
parsePathSegments(CharSequence s,
java.nio.charset.Charset charset)
Returns a list of URI path segments.
|
public static String format(Iterable<? extends NameValuePair> parameters, char parameterSeparator, java.nio.charset.Charset charset)
application/x-www-form-urlencoded
list of parameters in an HTTP PUT or HTTP POST.parameters
- The parameters to include.parameterSeparator
- The parameter separator, by convention, '&'
or ';'
.charset
- The encoding to use.application/x-www-form-urlencoded
stringpublic static String format(Iterable<? extends NameValuePair> parameters, java.nio.charset.Charset charset)
application/x-www-form-urlencoded
list of parameters in an HTTP PUT or HTTP POST.parameters
- The parameters to include.charset
- The encoding to use.application/x-www-form-urlencoded
stringpublic static String formatSegments(Iterable<String> segments, java.nio.charset.Charset charset)
segments
- the segments.charset
- parameter charset.public static String formatSegments(String... segments)
segments
- the segments.public static List<NameValuePair> parse(CharSequence s, java.nio.charset.Charset charset)
NameValuePair
s URI query parameters.
By convention, '&'
and ';'
are accepted as parameter separators.s
- URI query component.charset
- charset to use when decoding the parameters.public static List<NameValuePair> parse(CharSequence s, java.nio.charset.Charset charset, char... separators)
NameValuePair
s parameters.s
- input text.charset
- parameter charset.separators
- parameter separators.public static List<NameValuePair> parse(URI uri, java.nio.charset.Charset charset)
NameValuePair
s URI query parameters.
By convention, '&'
and ';'
are accepted as parameter separators.uri
- input URI.charset
- parameter charset.public static List<String> parsePathSegments(CharSequence s)
s
- URI path component.public static List<String> parsePathSegments(CharSequence s, java.nio.charset.Charset charset)
s
- URI path component.charset
- parameter charset.