1. public static InputStream getInputStreamFromUrl(String url) {
2. InputStream content = null;
3. try {
4. HttpClient httpclient = new DefaultHttpClient();
5. HttpResponse response = httpclient.execute(new HttpGet(url));
6. content = response.getEntity().getContent();
7. } catch (Exception e) {
8. Log.("[GET REQUEST]", "Network exception", e);
9. }
10. return content;
11. }
GET Request with HttpClient
最新推荐文章于 2022-04-25 10:00:00 发布