我使用Apache的HttpClient通过httpclient-fluent-builder下载http页面。不能用HttpClient下载不同的服务器端口
这是代码:
...
try {
response = Http.get("http://fr3.ah.fm:9000/played.html")
.use(client) // use this HttpClient (required)
.charset("windows-1252") // set the encoding... (optional)
.asString();
} catch (IOException e) {
Log.d(TAG, "Error: "+e.toString());
e.printStackTrace();
}
Log.i(TAG, ""+ response);
...
问题是,我得到org.apache.http.client.ClientProtocolException
这件事情与主机:端口/ URL,东阳它的URL不工作端口。我还得到了另一个Httphelper类与流利构建器相同的错误。防火墙关闭。
的logcat:http://pastebin.com/yMMvvdQ3
如果您在浏览器中点击http://fr3.ah.fm:9000/played.html,它会给你一些有效的东西? – 2010-08-18 22:46:14
是的,我试着从我的常规浏览器和模拟器内的Android浏览器。 – droidgren 2010-08-18 23:21:40