1
2
3
4
5
6
7
8
9
|
URL url =
new
URL(
"http://www.android.com/"
);
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
try
{
InputStream in =
new
BufferedInputStream(urlConnection.getInputStream());
readStream(in);
finally
{
urlConnection.disconnect();
}
}
|
用HttpURLConnection代替HttpClient
最新推荐文章于 2024-06-04 10:24:49 发布