在下面的示例代码中,uri何时不等于url?
HttpClient client = new DefaultHttpClient();
String url = "http://domain/path1/path2"
HttpGet get = new HttpGet(toFetchURL);
HttpResponse response = client.execute(get);
String uri = get.getURI.toString();
if (!uri.equals(url)) {
// when would this happen?
// some logic
}
答案 0 :(得分:0)
URL是URI的子集。所以URL可以转换为URI,但URI不能转换为URL。