We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 82b4c2f commit 7b816b5Copy full SHA for 7b816b5
Test.class
155 Bytes
Test.java
@@ -3,6 +3,7 @@
3
4
import java.net.URL;
5
import java.net.URLConnection;
6
+import java.net.HttpURLConnection;
7
8
import java.util.logging.ConsoleHandler;
9
import java.util.logging.SimpleFormatter;
@@ -47,6 +48,11 @@ public static void main(String[] args) throws Exception {
47
48
49
in.readLine();
50
51
+ if (conn instanceof HttpURLConnection) {
52
+ int code = ((HttpURLConnection)conn).getResponseCode();
53
+ theLogger.info("Response status code received " + code);
54
+ }
55
+
56
in.close();
57
reader.close();
58
0 commit comments