public abstract class AbstractHtmlClientImpl extends Object implements org.apache.http.client.HttpClient, HtmlClient
| Modifier and Type | Field and Description |
|---|---|
protected URI |
baseUrl |
protected org.apache.http.impl.client.CloseableHttpClient |
client |
protected static org.slf4j.Logger |
LOG |
| Constructor and Description |
|---|
AbstractHtmlClientImpl(org.apache.http.impl.client.CloseableHttpClient client,
String baseUrl) |
AbstractHtmlClientImpl(String baseUrl) |
AbstractHtmlClientImpl(String baseUrl,
String user,
String password) |
| Modifier and Type | Method and Description |
|---|---|
<T extends Document> |
delete(String url)
Performs a DELETE request and returns a Document
|
<T extends Document> |
enter(String url)
Enters a url and return a Document
|
org.apache.http.HttpResponse |
execute(org.apache.http.HttpHost httpHost,
org.apache.http.HttpRequest httpRequest) |
org.apache.http.HttpResponse |
execute(org.apache.http.HttpHost httpHost,
org.apache.http.HttpRequest httpRequest,
org.apache.http.protocol.HttpContext httpContext) |
<T> T |
execute(org.apache.http.HttpHost httpHost,
org.apache.http.HttpRequest httpRequest,
org.apache.http.client.ResponseHandler<? extends T> responseHandler) |
<T> T |
execute(org.apache.http.HttpHost httpHost,
org.apache.http.HttpRequest httpRequest,
org.apache.http.client.ResponseHandler<? extends T> responseHandler,
org.apache.http.protocol.HttpContext httpContext) |
org.apache.http.HttpResponse |
execute(org.apache.http.client.methods.HttpUriRequest httpUriRequest) |
org.apache.http.HttpResponse |
execute(org.apache.http.client.methods.HttpUriRequest httpUriRequest,
org.apache.http.protocol.HttpContext httpContext) |
<T> T |
execute(org.apache.http.client.methods.HttpUriRequest httpUriRequest,
org.apache.http.client.ResponseHandler<? extends T> responseHandler) |
<T> T |
execute(org.apache.http.client.methods.HttpUriRequest httpUriRequest,
org.apache.http.client.ResponseHandler<? extends T> responseHandler,
org.apache.http.protocol.HttpContext httpContext) |
<T extends Document> |
get(String url)
Performs a GET request and returns a Document
|
org.apache.http.conn.ClientConnectionManager |
getConnectionManager() |
org.apache.http.params.HttpParams |
getParams() |
abstract <T extends Document> |
newDocument(String html)
Method to create a new Document representation from an HTML content String
|
<T extends Document> |
post(String url,
org.apache.http.HttpEntity entity)
Performs a POST request.
|
protected static final org.slf4j.Logger LOG
protected org.apache.http.impl.client.CloseableHttpClient client
protected URI baseUrl
public AbstractHtmlClientImpl(org.apache.http.impl.client.CloseableHttpClient client,
String baseUrl)
throws URISyntaxException
URISyntaxExceptionpublic AbstractHtmlClientImpl(String baseUrl) throws URISyntaxException
URISyntaxExceptionpublic AbstractHtmlClientImpl(String baseUrl, String user, String password) throws URISyntaxException
URISyntaxExceptionpublic <T extends Document> T enter(String url) throws ClientException
HtmlCliententer in interface HtmlClientClientExceptionpublic <T extends Document> T get(String url) throws ClientException
HtmlClientget in interface HtmlClienturl - the URL String to perform an HTTP GET onClientExceptionpublic <T extends Document> T post(String url, org.apache.http.HttpEntity entity) throws ClientException
HtmlClientpost in interface HtmlClienturl - the URL String to perform an HTTP post onentity - data to postClientExceptionpublic <T extends Document> T delete(String url) throws ClientException
HtmlClientdelete in interface HtmlClienturl - the URL String to perform an HTTP DELETE onClientExceptionpublic abstract <T extends Document> T newDocument(String html)
HtmlClientnewDocument in interface HtmlClientpublic org.apache.http.params.HttpParams getParams()
getParams in interface org.apache.http.client.HttpClientpublic org.apache.http.conn.ClientConnectionManager getConnectionManager()
getConnectionManager in interface org.apache.http.client.HttpClientpublic org.apache.http.HttpResponse execute(org.apache.http.client.methods.HttpUriRequest httpUriRequest)
throws IOException,
org.apache.http.client.ClientProtocolException
execute in interface org.apache.http.client.HttpClientIOExceptionorg.apache.http.client.ClientProtocolExceptionpublic org.apache.http.HttpResponse execute(org.apache.http.client.methods.HttpUriRequest httpUriRequest,
org.apache.http.protocol.HttpContext httpContext)
throws IOException,
org.apache.http.client.ClientProtocolException
execute in interface org.apache.http.client.HttpClientIOExceptionorg.apache.http.client.ClientProtocolExceptionpublic org.apache.http.HttpResponse execute(org.apache.http.HttpHost httpHost,
org.apache.http.HttpRequest httpRequest)
throws IOException,
org.apache.http.client.ClientProtocolException
execute in interface org.apache.http.client.HttpClientIOExceptionorg.apache.http.client.ClientProtocolExceptionpublic org.apache.http.HttpResponse execute(org.apache.http.HttpHost httpHost,
org.apache.http.HttpRequest httpRequest,
org.apache.http.protocol.HttpContext httpContext)
throws IOException,
org.apache.http.client.ClientProtocolException
execute in interface org.apache.http.client.HttpClientIOExceptionorg.apache.http.client.ClientProtocolExceptionpublic <T> T execute(org.apache.http.client.methods.HttpUriRequest httpUriRequest,
org.apache.http.client.ResponseHandler<? extends T> responseHandler)
throws IOException,
org.apache.http.client.ClientProtocolException
execute in interface org.apache.http.client.HttpClientIOExceptionorg.apache.http.client.ClientProtocolExceptionpublic <T> T execute(org.apache.http.client.methods.HttpUriRequest httpUriRequest,
org.apache.http.client.ResponseHandler<? extends T> responseHandler,
org.apache.http.protocol.HttpContext httpContext)
throws IOException,
org.apache.http.client.ClientProtocolException
execute in interface org.apache.http.client.HttpClientIOExceptionorg.apache.http.client.ClientProtocolExceptionpublic <T> T execute(org.apache.http.HttpHost httpHost,
org.apache.http.HttpRequest httpRequest,
org.apache.http.client.ResponseHandler<? extends T> responseHandler)
throws IOException,
org.apache.http.client.ClientProtocolException
execute in interface org.apache.http.client.HttpClientIOExceptionorg.apache.http.client.ClientProtocolExceptionpublic <T> T execute(org.apache.http.HttpHost httpHost,
org.apache.http.HttpRequest httpRequest,
org.apache.http.client.ResponseHandler<? extends T> responseHandler,
org.apache.http.protocol.HttpContext httpContext)
throws IOException,
org.apache.http.client.ClientProtocolException
execute in interface org.apache.http.client.HttpClientIOExceptionorg.apache.http.client.ClientProtocolExceptionCopyright © 2007–2016 The Apache Software Foundation. All rights reserved.