この単純なコードを使用して、Android で単純な http 要求を実行しようとしています。
HttpPost httpPost = new HttpPost(url);
HttpResponse httpResponse = httpClient.execute(httpPost);
HttpEntity httpEntity = httpResponse.getEntity();
return EntityUtils.toString(httpEntity);
私がテストしたすべてのデバイスでは正常に動作しますが (Android 2.3.6 +)、今日テストした HTC Desire (Android 2.3.5) はタイムアウトで失敗します。しかし、これは次のような特定の URL でのみ発生しました。
http://api.mydomain.com/some/path/index.php?param=value+number¶m2=value
次のような別のURLを試してみると:
http://www.google.com
HTC でも動作します。これらのデバイス/URLでのみタイムアウトが発生するのはなぜですか?