public final class HttpClient extends Object
settings
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_CONNECTION_TIMEOUT
Unit is milliseconds.
|
static int |
DEFAULT_MAX_CONNECTION |
static int |
DEFAULT_READ_TIMEOUT |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close.
|
static HttpClient |
create(String url) |
static HttpClient |
create(String url,
int maxConnection) |
static HttpClient |
create(String url,
int maxConnection,
long connectionTimeoutInMillis,
long readTimeoutInMillis) |
static HttpClient |
create(String url,
int maxConnection,
long connectionTimeoutInMillis,
long readTimeoutInMillis,
HttpSettings settings) |
static HttpClient |
create(String url,
int maxConnection,
long connectionTimeoutInMillis,
long readTimeoutInMillis,
HttpSettings settings,
AtomicInteger sharedActiveConnectionCounter) |
static HttpClient |
create(String url,
long connectionTimeoutInMillis,
long readTimeoutInMillis) |
String |
delete() |
<T> T |
delete(Class<T> resultClass) |
<T> T |
delete(Class<T> resultClass,
HttpSettings settings) |
<T> T |
delete(Class<T> resultClass,
Object queryParameters) |
<T> T |
delete(Class<T> resultClass,
Object queryParameters,
HttpSettings settings) |
String |
delete(HttpSettings settings) |
String |
delete(Object queryParameters) |
String |
delete(Object queryParameters,
HttpSettings settings) |
<T> T |
execute(Class<T> resultClass,
HttpMethod httpMethod,
Object request) |
<T> T |
execute(Class<T> resultClass,
HttpMethod httpMethod,
Object request,
HttpSettings settings) |
void |
execute(File output,
HttpMethod httpMethod,
Object request,
HttpSettings settings) |
String |
execute(HttpMethod httpMethod,
Object request) |
String |
execute(HttpMethod httpMethod,
Object request,
HttpSettings settings) |
void |
execute(OutputStream output,
HttpMethod httpMethod,
Object request,
HttpSettings settings) |
void |
execute(Writer output,
HttpMethod httpMethod,
Object request,
HttpSettings settings) |
String |
get() |
<T> T |
get(Class<T> resultClass) |
<T> T |
get(Class<T> resultClass,
HttpSettings settings) |
<T> T |
get(Class<T> resultClass,
Object queryParameters) |
<T> T |
get(Class<T> resultClass,
Object queryParameters,
HttpSettings settings) |
String |
get(HttpSettings settings) |
String |
get(Object queryParameters) |
String |
get(Object queryParameters,
HttpSettings settings) |
<T> T |
post(Class<T> resultClass,
Object request) |
<T> T |
post(Class<T> resultClass,
Object request,
HttpSettings settings) |
String |
post(Object request) |
String |
post(Object request,
HttpSettings settings) |
<T> T |
put(Class<T> resultClass,
Object request) |
<T> T |
put(Class<T> resultClass,
Object request,
HttpSettings settings) |
String |
put(Object request) |
String |
put(Object request,
HttpSettings settings) |
String |
url() |
public static final int DEFAULT_MAX_CONNECTION
public static final int DEFAULT_CONNECTION_TIMEOUT
public static final int DEFAULT_READ_TIMEOUT
public static HttpClient create(String url)
url - public static HttpClient create(String url, int maxConnection)
url - maxConnection - public static HttpClient create(String url, long connectionTimeoutInMillis, long readTimeoutInMillis)
url - connectionTimeoutInMillis - readTimeoutInMillis - public static HttpClient create(String url, int maxConnection, long connectionTimeoutInMillis, long readTimeoutInMillis)
url - maxConnection - connectionTimeoutInMillis - readTimeoutInMillis - public static HttpClient create(String url, int maxConnection, long connectionTimeoutInMillis, long readTimeoutInMillis, HttpSettings settings) throws UncheckedIOException
url - maxConnection - connectionTimeoutInMillis - readTimeoutInMillis - settings - UncheckedIOException - the unchecked IO exceptionpublic static HttpClient create(String url, int maxConnection, long connectionTimeoutInMillis, long readTimeoutInMillis, HttpSettings settings, AtomicInteger sharedActiveConnectionCounter)
url - maxConnection - connectionTimeoutInMillis - readTimeoutInMillis - settings - sharedActiveConnectionCounter - public String url()
public String get() throws UncheckedIOException
UncheckedIOException - the unchecked IO exceptionpublic String get(HttpSettings settings) throws UncheckedIOException
settings - UncheckedIOException - the unchecked IO exceptionpublic String get(Object queryParameters) throws UncheckedIOException
queryParameters - UncheckedIOException - the unchecked IO exceptionpublic String get(Object queryParameters, HttpSettings settings) throws UncheckedIOException
queryParameters - settings - UncheckedIOException - the unchecked IO exceptionpublic <T> T get(Class<T> resultClass) throws UncheckedIOException
T - resultClass - UncheckedIOException - the unchecked IO exceptionpublic <T> T get(Class<T> resultClass, HttpSettings settings) throws UncheckedIOException
T - resultClass - settings - UncheckedIOException - the unchecked IO exceptionpublic <T> T get(Class<T> resultClass, Object queryParameters) throws UncheckedIOException
T - resultClass - queryParameters - UncheckedIOException - the unchecked IO exceptionpublic <T> T get(Class<T> resultClass, Object queryParameters, HttpSettings settings) throws UncheckedIOException
T - resultClass - queryParameters - settings - UncheckedIOException - the unchecked IO exceptionpublic String delete() throws UncheckedIOException
UncheckedIOException - the unchecked IO exceptionpublic String delete(HttpSettings settings) throws UncheckedIOException
settings - UncheckedIOException - the unchecked IO exceptionpublic String delete(Object queryParameters) throws UncheckedIOException
queryParameters - UncheckedIOException - the unchecked IO exceptionpublic String delete(Object queryParameters, HttpSettings settings) throws UncheckedIOException
queryParameters - settings - UncheckedIOException - the unchecked IO exceptionpublic <T> T delete(Class<T> resultClass) throws UncheckedIOException
T - resultClass - UncheckedIOException - the unchecked IO exceptionpublic <T> T delete(Class<T> resultClass, HttpSettings settings) throws UncheckedIOException
T - resultClass - settings - UncheckedIOException - the unchecked IO exceptionpublic <T> T delete(Class<T> resultClass, Object queryParameters) throws UncheckedIOException
T - resultClass - queryParameters - UncheckedIOException - the unchecked IO exceptionpublic <T> T delete(Class<T> resultClass, Object queryParameters, HttpSettings settings) throws UncheckedIOException
T - resultClass - queryParameters - settings - UncheckedIOException - the unchecked IO exceptionpublic String post(Object request) throws UncheckedIOException
request - UncheckedIOException - the unchecked IO exceptionpublic String post(Object request, HttpSettings settings) throws UncheckedIOException
request - settings - UncheckedIOException - the unchecked IO exceptionpublic <T> T post(Class<T> resultClass, Object request) throws UncheckedIOException
T - resultClass - request - UncheckedIOException - the unchecked IO exceptionpublic <T> T post(Class<T> resultClass, Object request, HttpSettings settings) throws UncheckedIOException
T - resultClass - request - settings - UncheckedIOException - the unchecked IO exceptionpublic String put(Object request) throws UncheckedIOException
request - UncheckedIOException - the unchecked IO exceptionpublic String put(Object request, HttpSettings settings) throws UncheckedIOException
request - settings - UncheckedIOException - the unchecked IO exceptionpublic <T> T put(Class<T> resultClass, Object request) throws UncheckedIOException
T - resultClass - request - UncheckedIOException - the unchecked IO exceptionpublic <T> T put(Class<T> resultClass, Object request, HttpSettings settings) throws UncheckedIOException
T - resultClass - request - settings - UncheckedIOException - the unchecked IO exceptionpublic String execute(HttpMethod httpMethod, Object request) throws UncheckedIOException
httpMethod - request - UncheckedIOException - the unchecked IO exceptionpublic String execute(HttpMethod httpMethod, Object request, HttpSettings settings) throws UncheckedIOException
httpMethod - request - settings - UncheckedIOException - the unchecked IO exceptionpublic <T> T execute(Class<T> resultClass, HttpMethod httpMethod, Object request) throws UncheckedIOException
T - resultClass - httpMethod - request - UncheckedIOException - the unchecked IO exceptionpublic <T> T execute(Class<T> resultClass, HttpMethod httpMethod, Object request, HttpSettings settings) throws UncheckedIOException
T - resultClass - httpMethod - request - settings - UncheckedIOException - the unchecked IO exceptionpublic void execute(File output, HttpMethod httpMethod, Object request, HttpSettings settings) throws UncheckedIOException
output - httpMethod - request - settings - UncheckedIOException - the unchecked IO exceptionpublic void execute(OutputStream output, HttpMethod httpMethod, Object request, HttpSettings settings) throws UncheckedIOException
output - httpMethod - request - settings - UncheckedIOException - the unchecked IO exceptionpublic void execute(Writer output, HttpMethod httpMethod, Object request, HttpSettings settings) throws UncheckedIOException
output - httpMethod - request - settings - UncheckedIOException - the unchecked IO exceptionpublic void close()
Copyright © 2021. All rights reserved.