getResponseCode()未报错没反应

来源:互联网 发布:淘宝预约快递寄件 编辑:程序博客网 时间:2024/04/30 19:12

getResponseCode()未报错没反应

今天做android Demo的时候网络连接出问题,getResponseCode()没有报错也没有反应

设置了timeOut(10000)也不会超时,但是servlet并没有接收到!


经过挣扎发现原因,url写的是

http://localhost:8080/Tourisum_Server/LoginServlet
虽然游览器上可以,但安卓模拟器并不会解析localhost,于是改成127.0.0.1:8080,还是不行。
最后改成了ip就能访问了

原创粉丝点击