@Override @SuppressWarnings("deprecation") public synchronized void setTimeout(int newTimeoutInMilliseconds) { delegate.setTimeout(newTimeoutInMilliseconds); }
/***********************************************************************/ public InputStream getResponse(HttpClient client, PostMethod post) throws HttpException, IOException { // My_System.markerIn(); // My_System.variable(post.getURI().toString()); // My_System.variable("parameters", post.getParameters()); client.setConnectionTimeout(30000); client.setTimeout(30000); client.executeMethod(post); InputStream r = post.getResponseBodyAsStream(); // My_System.markerOut(); return r; } /***********************************************************************/
private GetMethod doGet(URL url, int timeout) throws IOException { HttpClient client = getClient(); client.setTimeout(timeout); GetMethod get = new GetMethod(normalizeToString(url)); get.setDoAuthentication(useAuthentication(url) || useProxyAuthentication()); get.setRequestHeader("Accept-Encoding", "gzip,deflate"); client.executeMethod(get); return get; }
private HeadMethod doHead(URL url, int timeout) throws IOException { HttpClient client = getClient(); client.setTimeout(timeout); HeadMethod head = new HeadMethod(normalizeToString(url)); head.setDoAuthentication(useAuthentication(url) || useProxyAuthentication()); client.executeMethod(head); return head; }