我与服务器建立连接,其工作的罚款。但有时当我尝试获得响应code(当服务器被抛回401,403,404),我得到IO异常。我是基于响应code处理一切。因此,当它抛出IO异常对
i am establishing connection with the server and its working fine. But there are times when i try to get the response code (when server is throwing back 401, 403, 404) i am getting IO Exception. I am handling everything based on the response code. So when it throws IO exception on
http.getResponseCode()
我不能够读取响应code。请提出一个解决方案。
i am not able to read the response code. Please suggest a solution for this.
在此之前的Android 2.3的HttpURLConnection有一些的问题。它能够更好地使用Defaulthttpclient API。看来你的问题类似于这。
Prior to android 2.3 HttpUrlConnection has few issues. Its better to use Defaulthttpclient api. Seems your issue is similar to this.
上一篇:我怎样才能关闭车展亚行控制台在Eclipse的?控制台、车展、Eclipse
下一篇:安卓:安装错误:INSTALL_FAILED_INSUFFICIENT_STORAGE错误、INSTALL_FAILED_INSUFFICIENT_STORAG