我正在使用以下代码在 Android 应用程序中执行 HTTP 请求:
try
{
HttpPost post = new HttpPost(<URL>);
HttpClient client = new DefaultHttpClient();
HttpResponse response = client.execute(post);
HttpEntity entity = response.getEntity();
String responseText = EntityUtils.toString(entity);
parseResponce(responseText);
}
catch (Exception e)
{
Log.e("http post error : ", e.getMessage());
}
该请求适用于 android 2.3,但我没有在 Android 4.0.4 中收到响应。为什么不?