1

I have a web server that can return an http response code 503 with data in it’s body.

When I use the following code:

URL appURL = new URL("http://sample.com");   
HttpURLConnection httpConn = (HttpURLConnection)appURL.openConnection();
int responseCode = httpConn.getResponseCode();

It throws an I/O exception when an http 503 response code is received, hence I can’t phrase response body.

Please advice.

Thanks, Ori

4

0 に答える 0