私はこのコードを実行している間に、インターネットは私が例外にURLjava.io.IOException:サーバーは、HTTP応答コードを返しました:JAVA
URLjava.io.IOException: Server returned HTTP response code: 411
を取得しています
URL url = new URL("http://www.google.co.in/");
final HttpURLConnection conn = (HttpURLConnection) url.openConnection();
// set connect timeout.
conn.setConnectTimeout(1000000);
// set read timeout.
conn.setReadTimeout(1000000);
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type","text/xml");
conn.setDoOutput(true);
conn.connect();
Integer code = conn.getResponseCode();
final String contentType = conn.getContentType();
利用可能であるかどうかをチェックしています
エラーが発生する可能性があります。
[Might help](http://www.checkupdown.com/status/E411.html) –