【发布时间】:2012-08-11 17:50:35
【问题描述】:
我正在尝试发送一个 http 请求并通过黑莓获得响应。我使用了以下代码 sn-p。
String url="http://www.google.lk/";
HttpConnection con = null;
InputStream is = null;
try {
con = (HttpConnection) Connector.open(url);
int responseCode = con.getResponseCode(); // LINE X
Dialog.alert(String.valueOf(responseCode ));
}
catch(Exception e){
Dialog.alert(e.getMessage());
}
但是代码永远不会通过LINE X。没有错误。它只是等待并最终超时。可能是什么问题呢?
提前致谢。
【问题讨论】:
标签: http blackberry