我正在做一个android应用程序,我只是做了一个get http请求,我只想知道我做错了什么。
这是我的要求:
try {
String encodedUserNAme = idDispositivo;
encodedUserNAme = URLEncoder.encode(encodedUserNAme, "utf-8");
String url = Constants.URL_OBTENER_GRUPO + "?" + "user="+ idDispositivo;
Log.w("ObtenerIDGrupo "," url: "+url);
HttpClient client = Constants.getHttpClient();
HttpGet httpget;
try {
httpget = new HttpGet(new URI(url));
try{
HttpResponse response = client.execute(httpget);
String responseBody = EntityUtils.toString(response.getEntity());
Log.w("ObtenerIDGrupo "," RESPONSEBODY= "+responseBody);
idGrupo = responseBody;
Log.w("ObtenerIDGrupo "," idGrupo= "+responseBody);
}catch(ClientProtocolException e){
e.printStackTrace();
}catch(IOException e){
e.printStackTrace();
}
} catch (URISyntaxException e1) {
e1.printStackTrace();
}
} catch (IOException e) {
Log.w("IOException" + e);
e.printStackTrace();
}
这是我的回应:
我不知道为什么会有这样的反应。有人能帮助我吗?
谢谢