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
URISyntaxException
public AbstractHtmlClientImpl(String baseUrl) throws URISyntaxException
URISyntaxException
public AbstractHtmlClientImpl(String baseUrl, String user, String password) throws URISyntaxException
URISyntaxException
public <T extends Document> T enter(String url) throws ClientException
HtmlClient
enter
in interface HtmlClient
ClientException
public <T extends Document> T get(String url) throws ClientException
HtmlClient
get
in interface HtmlClient
url
- the URL String to perform an HTTP GET onClientException
public <T extends Document> T post(String url, org.apache.http.HttpEntity entity) throws ClientException
HtmlClient
post
in interface HtmlClient
url
- the URL String to perform an HTTP post onentity
- data to postClientException
public <T extends Document> T delete(String url) throws ClientException
HtmlClient
delete
in interface HtmlClient
url
- the URL String to perform an HTTP DELETE onClientException
public abstract <T extends Document> T newDocument(String html)
HtmlClient
newDocument
in interface HtmlClient
public org.apache.http.params.HttpParams getParams()
getParams
in interface org.apache.http.client.HttpClient
public org.apache.http.conn.ClientConnectionManager getConnectionManager()
getConnectionManager
in interface org.apache.http.client.HttpClient
public 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.HttpClient
IOException
org.apache.http.client.ClientProtocolException
public 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.HttpClient
IOException
org.apache.http.client.ClientProtocolException
public 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.HttpClient
IOException
org.apache.http.client.ClientProtocolException
public 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.HttpClient
IOException
org.apache.http.client.ClientProtocolException
public <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.HttpClient
IOException
org.apache.http.client.ClientProtocolException
public <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.HttpClient
IOException
org.apache.http.client.ClientProtocolException
public <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.HttpClient
IOException
org.apache.http.client.ClientProtocolException
public <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.HttpClient
IOException
org.apache.http.client.ClientProtocolException
Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.