Android Studio发送http请求服务器没有响应
用java web工程写了一个servlet并配置了tomcat,能成功运行,并在浏览器上输入url "http://xxxxxx:8080/hello/DataServiceServlet“服务器端有反应,但是在android studio通过模拟器执行URL httpUrl = new URL(url);
/*获取网络连接*/
HttpURLConnection conn = (HttpURLConnection) httpUrl.openConnection();
/*设置请求方法为GET方法*/
conn.setRequestMethod("GET");
/*设置访问超时时间*/
conn.setReadTimeout(5000);时没有报错但服务器也没反应,换了台电脑,但是连的是真机服务器就有反应了
请问这是为啥