Skip to content

Commit 7b816b5

Browse files
updated code
1 parent 82b4c2f commit 7b816b5

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Test.class

155 Bytes
Binary file not shown.

Test.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import java.net.URL;
55
import java.net.URLConnection;
6+
import java.net.HttpURLConnection;
67

78
import java.util.logging.ConsoleHandler;
89
import java.util.logging.SimpleFormatter;
@@ -47,6 +48,11 @@ public static void main(String[] args) throws Exception {
4748

4849
in.readLine();
4950

51+
if (conn instanceof HttpURLConnection) {
52+
int code = ((HttpURLConnection)conn).getResponseCode();
53+
theLogger.info("Response status code received " + code);
54+
}
55+
5056
in.close();
5157
reader.close();
5258

0 commit comments

Comments
 (0)