用HttpURLConnection请求百度首页成功,(GET请求)请求这个地址也成功:http://10.207.112.191:8080,说明后台服务器可用但请求这个地址不成功:http://10.207.112.191:8080/user/user后台测试代码:用的是SpringMVC@RequestMapping(value = "/user", method = RequestMethod.GET) public void Reply(HttpServletResponse response) throws IOException { PrintWriter out = response.getWriter(); System.out.println("来自安卓"); out.print("OK"); out.flush(); out.close(); }logcat:D/NetworkSecurityConfig: No Network Security Config specified, using platform defaultD/Tag: 未进入httpW/System.err: java.io.FileNotFoundException: http://10.207.112.191:8080/userW/System.err: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:250)W/System.err: at hope.HttpUtil.HttpUtil$1.run(HttpUtil.java:43)W/System.err: at java.lang.Thread.run(Thread.java:761)
目前暂无任何回答
- 0 回答
- 0 关注
- 5507 浏览
添加回答
举报
0/150
提交
取消