|
||||||||||
| 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 HttpClient |
createHttpClient()
Creates the HttpClient that will be used by this WebConnection. |
protected 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. |
String |
getVirtualHost()
Gets the virtual host. |
protected WebResponseData |
newWebResponseDataInstance(String statusMessage,
List<NameValuePair> headers,
int statusCode,
HttpMethodBase method)
Constructs an appropriate WebResponseData. |
protected WebResponse |
newWebResponseInstance(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(HttpMethodBase httpMethod)
Called when the response has been generated. |
void |
setVirtualHost(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 IOException
getResponse in interface WebConnectionsettings - Settings to make the request with
IOException - if an IO error occursprotected void onResponseGenerated(HttpMethodBase httpMethod)
httpMethod - the httpMethod usedprotected HttpClient getHttpClient()
protected int getTimeout()
protected HttpClient createHttpClient()
HttpConnectionManager to perform some tracking;
see feature request 1438216).
public void setVirtualHost(String virtualHost)
virtualHost - the virtualHost to setpublic String getVirtualHost()
protected WebResponseData newWebResponseDataInstance(String statusMessage,
List<NameValuePair> headers,
int statusCode,
HttpMethodBase method)
throws IOException
statusMessage - StatusMessage from the responseheaders - response headersstatusCode - response status codemethod - request method
IOException - if there is a problem reading the response body
@Deprecated
protected WebResponse newWebResponseInstance(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 | |||||||||