|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.gargoylesoftware.htmlunit.HttpWebConnection
public class HttpWebConnection
Default implementation of WebConnection, using the HttpClient library to perform HTTP requests.
| Constructor Summary | |
|---|---|
HttpWebConnection(WebClient webClient)
Creates a new HTTP web connection instance. |
|
| Method Summary | |
|---|---|
protected org.apache.commons.httpclient.HttpClient |
createHttpClient()
Creates the HttpClient that will be used by this WebConnection. |
static DownloadedContent |
downloadContent(java.io.InputStream is)
Reads the content of the stream and saves it in memory or on the file system. |
protected org.apache.commons.httpclient.HttpClient |
getHttpClient()
Lazily initializes the internal HTTP client. |
WebResponse |
getResponse(WebRequestSettings settings)
Submits a request and retrieves a response. |
protected int |
getTimeout()
Returns the timeout to use for socket and connection timeouts for HttpConnectionManager. |
java.lang.String |
getVirtualHost()
Gets the virtual host. |
protected WebResponseData |
newWebResponseDataInstance(java.lang.String statusMessage,
java.util.List<org.apache.commons.httpclient.NameValuePair> headers,
int statusCode,
org.apache.commons.httpclient.HttpMethodBase method)
Constructs an appropriate WebResponseData. |
protected WebResponse |
newWebResponseInstance(java.lang.String charset,
WebResponseData responseData,
long loadTime,
WebRequestSettings requestSettings)
Deprecated. As of 2.6, please use newWebResponseInstance(WebResponseData, long, WebRequestSettings) |
protected WebResponse |
newWebResponseInstance(WebResponseData responseData,
long loadTime,
WebRequestSettings requestSettings)
Constructs an appropriate WebResponse. |
protected void |
onResponseGenerated(org.apache.commons.httpclient.HttpMethodBase httpMethod)
Called when the response has been generated. |
void |
setVirtualHost(java.lang.String virtualHost)
Sets the virtual host. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HttpWebConnection(WebClient webClient)
webClient - the WebClient that is using this connection| Method Detail |
|---|
public WebResponse getResponse(WebRequestSettings settings)
throws java.io.IOException
getResponse in interface WebConnectionsettings - Settings to make the request with
java.io.IOException - if an IO error occursprotected void onResponseGenerated(org.apache.commons.httpclient.HttpMethodBase httpMethod)
httpMethod - the httpMethod usedprotected org.apache.commons.httpclient.HttpClient getHttpClient()
protected int getTimeout()
protected org.apache.commons.httpclient.HttpClient createHttpClient()
HttpConnectionManager to perform some tracking;
see feature request 1438216).
public void setVirtualHost(java.lang.String virtualHost)
virtualHost - the virtualHost to setpublic java.lang.String getVirtualHost()
public static DownloadedContent downloadContent(java.io.InputStream is)
throws java.io.IOException
is - the stream to read
java.io.IOException - in case of read issues
protected WebResponseData newWebResponseDataInstance(java.lang.String statusMessage,
java.util.List<org.apache.commons.httpclient.NameValuePair> headers,
int statusCode,
org.apache.commons.httpclient.HttpMethodBase method)
throws java.io.IOException
statusMessage - StatusMessage from the responseheaders - response headersstatusCode - response status codemethod - request method
java.io.IOException - if there is a problem reading the response body
@Deprecated
protected WebResponse newWebResponseInstance(java.lang.String charset,
WebResponseData responseData,
long loadTime,
WebRequestSettings requestSettings)
newWebResponseInstance(WebResponseData, long, WebRequestSettings)
responseData - Data that was send backcharset - Charset used if not returned in the responserequestSettings - the request settings used to get this responseloadTime - How long the response took to be sent
protected WebResponse newWebResponseInstance(WebResponseData responseData,
long loadTime,
WebRequestSettings requestSettings)
responseData - Data that was send backrequestSettings - the request settings used to get this responseloadTime - How long the response took to be sent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||