对url进行解析,可以参考org.apache.http.client.utils 包下面的URLEncodedUtils类
Class URLEncodedUtils
Class URLEncodedUtils
具体参见:http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/client/utils/URLEncodedUtils.html
Method Summary
Modifier and Type | Method and Description |
---|---|
static String | format(Iterable<? extends NameValuePair> parameters, 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(List<? extends NameValuePair> parameters, String encoding)
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 boolean | isEncoded(HttpEntity entity)
Returns true if the entity's Content-Type header is
application/x-www-form-urlencoded .
|
static List<NameValuePair> | parse(HttpEntity entity)
Returns a list of
NameValuePairs as parsed from an
HttpEntity .
|
static void | parse(List<NameValuePair> parameters,Scanner scanner, String charset)
Adds all parameters within the Scanner to the list of
parameters , as encoded by
encoding .
|
static List<NameValuePair> | parse(String s,Charset charset)
Returns a list of
NameValuePairs as parsed from the given string using the given character encoding.
|
static List<NameValuePair> | parse(URI uri,String encoding)
Returns a list of
NameValuePairs as built from the URI's query portion.
|
URL和URI的区别:待完善