public class HttpClientService extends Object
HttpUriRequests
separately by using distinct HttpClientContext.StatefulHttpClientService| Modifier and Type | Class and Description |
|---|---|
static interface |
HttpClientService.RequestCustomizer
Make some modifications to all HttpUriRequests before execution.
|
| Constructor and Description |
|---|
HttpClientService(org.apache.http.impl.client.CloseableHttpClient httpClient) |
HttpClientService(org.apache.http.impl.client.CloseableHttpClient httpClient,
HttpClientService.RequestCustomizer customizer) |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Release underlying resources.
|
org.apache.http.client.methods.CloseableHttpResponse |
execute(org.apache.http.client.methods.HttpUriRequest request,
org.apache.http.client.protocol.HttpClientContext cxt) |
String |
request(org.apache.http.client.methods.HttpUriRequest req,
org.apache.http.client.protocol.HttpClientContext cxt,
String defaultCharset)
Send request and reads the response content
|
public HttpClientService(org.apache.http.impl.client.CloseableHttpClient httpClient)
public HttpClientService(org.apache.http.impl.client.CloseableHttpClient httpClient,
HttpClientService.RequestCustomizer customizer)
public void dispose()
throws IOException
IOExceptionpublic String request(org.apache.http.client.methods.HttpUriRequest req, org.apache.http.client.protocol.HttpClientContext cxt, String defaultCharset)
req - public org.apache.http.client.methods.CloseableHttpResponse execute(org.apache.http.client.methods.HttpUriRequest request,
org.apache.http.client.protocol.HttpClientContext cxt)
throws IOException
IOExceptionCopyright © 2016. All rights reserved.