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

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -