Java HTTP Response Code, URL, IOException -
i'm getting 503 response server i'm trying communicate with. now, shows me in log, but, want catch ioexception fires , deal if , if response code 503, , nothing else. how this?
edit:
here's part of code:
inurl = new bufferedreader(new inputstreamreader(myurl.openstream())); string str; while ((str = inurl.readline()) != null) { writeto.write(str + "\n"); } inurl.close();
if using java.net.httpurlconnection
, use method getresponsecode()
if using org.apache.commons.httpclient.httpclient
, executemethod(...)
returns response code
Comments
Post a Comment