我只是想知道是否有人解决了这个问题.谷歌搜索提供了大量的帖子有这个问题,但没有一个有适当的答复.我试着使用和不使用代理的以下两段代码的每个组合:
/*********** URL METHOD ***************/
//URLConnection conn = aURL.openConnection();
//conn.connect();
//InputStream is = conn.getInputStream();
/*********** HTTP METHOD ***************/
HttpClient client = new DefaultHttpClient();
HttpGet get = new HttpGet(urlString);
HttpResponse resp = client.execute(get);
InputStream is = resp.getEntity().getContent();
Run Code Online (Sandbox Code Playgroud)
我正在尝试连接到我的Intranet上的站点(它不是localhost).我尝试过以下方法:
有什么想法吗?
let*_*nda 13
你应该看看这个:http: //developer.android.com/guide/appendix/faq/commontasks.html#localhostalias
(使用别名"10.0.2.2"而不是"localhost"或"127.0.0.1")
| 归档时间: |
|
| 查看次数: |
12382 次 |
| 最近记录: |