Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 管理响应以获取请求_Android_Http_Servlets_Get_Response - Fatal编程技术网

Android 管理响应以获取请求

Android 管理响应以获取请求,android,http,servlets,get,response,Android,Http,Servlets,Get,Response,我有一个android应用程序,它向安装在Tomcat上的servlet发送get请求。我将servlet生成一个html页面作为对get请求的响应 这是我的get请求代码。 我如何管理对目标的响应 try { HttpClient client = new DefaultHttpClient(); URI getURL = new URI("http://192.168.1.100:8080/MyServlet?param1="+param1+"&param2

我有一个android应用程序,它向安装在Tomcat上的servlet发送get请求。我将servlet生成一个html页面作为对get请求的响应

这是我的get请求代码。 我如何管理对目标的响应

try {
      HttpClient client = new DefaultHttpClient(); 
      URI getURL = new URI("http://192.168.1.100:8080/MyServlet?param1="+param1+"&param2="+param2);
      Log.i("QUERY",getURL.getQuery());
      HttpGet get = new HttpGet(getURL);
      HttpResponse responseGet = client.execute(get);  
      HttpEntity resEntityGet = responseGet.getEntity();  
      if (resEntityGet != null) { 
          Log.i("GET RESPONSE",EntityUtils.toString(resEntityGet));
     }

} catch (Exception e) {
      e.printStackTrace();
}

你的问题是什么???我想从我的java servlet在我的应用程序中生成(作为响应)一个html(或php)页面