メソッドの接続解除元がHttpURLConnection正しく機能していないようです。次のコードを実行すると:
url = new URL("http:// ...");
connection = (HttpURLConnection) url.openConnection ();
connection.setRequestMethod("POST");
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
connection.setUseCaches(false);
connection.setDoInput(true);
connection.setDoOutput(true);
connection.connect();
// Some code
connection.disconnect();
connection.setDoInput(false); // -> IllegalStateException
IllegalStateExceptionメソッドを呼び出すとが得られsetDoInputます。例外は言う:
接続済み