public class HttpClient extends Object implements AutoCloseable
Constructor and Description |
---|
HttpClient(org.apache.http.impl.client.CloseableHttpClient httpClient,
com.fasterxml.jackson.databind.ObjectMapper objectMapper) |
HttpClient(int socketTimeout,
int connectTimeout,
int connectionRequestTimeout) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
<T> T |
execute(org.apache.http.client.methods.HttpUriRequest request,
ValueReader<T> valueReader) |
<T> T |
execute(ValueReader<T> valueReader,
org.apache.http.client.methods.HttpUriRequest request)
Deprecated.
|
<T> T |
get(URI uri,
Class<T> valueType) |
<T> T |
get(URI uri,
com.fasterxml.jackson.core.type.TypeReference<T> valueTypeRef) |
<T> T |
get(URI uri,
com.fasterxml.jackson.core.type.TypeReference<T> valueTypeRef,
Map<?,?> params,
Map<?,?> headers) |
<T> T |
get(URI uri,
ValueReader<T> valueReader) |
<T> T |
get(URI uri,
ValueReader<T> valueReader,
Map<?,?> params,
Map<?,?> headers) |
<T> T |
post(URI uri,
Class<T> valueType,
Map<?,?> params,
Map<?,?> headers,
Charset charset) |
<T> T |
post(URI uri,
com.fasterxml.jackson.core.type.TypeReference<T> valueTypeRef,
Map<?,?> params,
Map<?,?> headers,
Charset charset) |
<T> T |
post(URI uri,
ValueReader<T> valueReader,
Iterable<? extends org.apache.http.NameValuePair> parameters,
org.apache.http.Header[] headers,
Charset charset) |
<T> T |
post(URI uri,
ValueReader<T> valueReader,
List<org.apache.http.NameValuePair> params) |
<T> T |
post(URI uri,
ValueReader<T> valueReader,
Map<?,?> params,
Map<?,?> headers,
Charset charset) |
<T> T |
post(URI uri,
ValueReader<T> valueReader,
org.apache.http.NameValuePair... params) |
<T> T |
post(URI uri,
ValueReader<T> valueReader,
String content,
org.apache.http.entity.ContentType contentType) |
<T> T |
post(URI uri,
ValueReader<T> valueReader,
String content,
String charset) |
public HttpClient(org.apache.http.impl.client.CloseableHttpClient httpClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
public HttpClient(int socketTimeout, int connectTimeout, int connectionRequestTimeout)
public <T> T get(URI uri, Class<T> valueType) throws IOException
IOException
public <T> T get(URI uri, com.fasterxml.jackson.core.type.TypeReference<T> valueTypeRef) throws IOException
IOException
public <T> T get(URI uri, com.fasterxml.jackson.core.type.TypeReference<T> valueTypeRef, @Nullable Map<?,?> params, @Nullable Map<?,?> headers) throws IOException
IOException
public <T> T get(URI uri, ValueReader<T> valueReader) throws IOException
IOException
public <T> T get(URI uri, ValueReader<T> valueReader, @Nullable Map<?,?> params, @Nullable Map<?,?> headers) throws IOException
IOException
public <T> T post(URI uri, Class<T> valueType, @Nullable Map<?,?> params, @Nullable Map<?,?> headers, @Nullable Charset charset) throws IOException
IOException
public <T> T post(URI uri, com.fasterxml.jackson.core.type.TypeReference<T> valueTypeRef, @Nullable Map<?,?> params, @Nullable Map<?,?> headers, @Nullable Charset charset) throws IOException
IOException
public <T> T post(URI uri, ValueReader<T> valueReader, org.apache.http.NameValuePair... params) throws IOException
IOException
public <T> T post(URI uri, ValueReader<T> valueReader, List<org.apache.http.NameValuePair> params) throws IOException
IOException
public <T> T post(URI uri, ValueReader<T> valueReader, @Nullable Map<?,?> params, @Nullable Map<?,?> headers, @Nullable Charset charset) throws IOException
IOException
public <T> T post(URI uri, ValueReader<T> valueReader, @Nullable Iterable<? extends org.apache.http.NameValuePair> parameters, @Nullable org.apache.http.Header[] headers, @Nullable Charset charset) throws IOException
IOException
public <T> T post(URI uri, ValueReader<T> valueReader, String content, String charset) throws IOException
IOException
public <T> T post(URI uri, ValueReader<T> valueReader, String content, org.apache.http.entity.ContentType contentType) throws IOException
IOException
@Deprecated public <T> T execute(ValueReader<T> valueReader, org.apache.http.client.methods.HttpUriRequest request) throws IOException
IOException
public <T> T execute(org.apache.http.client.methods.HttpUriRequest request, ValueReader<T> valueReader) throws IOException
IOException
public void close() throws IOException
close
in interface AutoCloseable
IOException
Copyright © 2013–2017. All rights reserved.