私のHttpUrlConnectionは2つのリクエストを作成していますが、コードで1回だけ送信しています。
以下は私のコードです:
HttpURLConnection urlConnection = null;
try
{
URL myUrl = new URL("http://" + url);
urlConnection = (HttpURLConnection) myUrl.openConnection();
urlConnection.setRequestMethod("GET");
urlConnection.setChunkedStreamingMode(0);
urlConnection.setRequestProperty("Accept-Encoding", "");
urlConnection.setRequestProperty("my-header", header);
int code = urlConnection.getResponseCode();
if(code != -1)
{
wv.loadUrl(myUrl.toString());
}
else
{
wv.loadUrl("http://www.google.com/search?q=" + url);
et_URL.setText(wv.getUrl());
}
サーバーからのログを見ると、2 つの GET リクエストが表示されます。
任意の体任意のアイデア??