public class HttpClientHelper extends Object
| Constructor and Description |
|---|
HttpClientHelper(org.apache.http.client.HttpClient httpClient)
Instantiates a new Http client service.
|
HttpClientHelper(org.apache.http.client.HttpClient httpClient,
JsonUtil jsonUtil)
Instantiates a new Http client service.
|
| Modifier and Type | Method and Description |
|---|---|
<T> T |
delete(Class<T> clazz,
String url,
org.apache.http.Header... headers)
Delete t.
|
String |
executeJson(org.apache.http.client.methods.HttpEntityEnclosingRequestBase httpBase,
Object entity)
Execute json string.
|
String |
executeJson(org.apache.http.client.methods.HttpRequestBase httpBase)
Execute json string.
|
<T> T |
get(Class<T> clazz,
String url,
org.apache.http.Header... headers)
Get t.
|
<T> T |
post(Class<T> clazz,
String url,
Object entity,
org.apache.http.Header... headers)
Post t.
|
<T> T |
put(Class<T> clazz,
String url,
Object entity,
org.apache.http.Header... headers)
Put t.
|
public HttpClientHelper(org.apache.http.client.HttpClient httpClient)
httpClient - the http clientpublic HttpClientHelper(org.apache.http.client.HttpClient httpClient,
JsonUtil jsonUtil)
httpClient - the http clientjsonUtil - the json utilpublic <T> T post(Class<T> clazz, String url, Object entity, org.apache.http.Header... headers)
T - the type parameterclazz - the clazzurl - the urlentity - the entityheaders - the headerspublic String executeJson(org.apache.http.client.methods.HttpEntityEnclosingRequestBase httpBase, Object entity)
httpBase - the http baseentity - the entitypublic String executeJson(org.apache.http.client.methods.HttpRequestBase httpBase)
httpBase - the http basepublic <T> T put(Class<T> clazz, String url, Object entity, org.apache.http.Header... headers)
T - the type parameterclazz - the clazzurl - the urlentity - the entityheaders - the headerspublic <T> T get(Class<T> clazz, String url, org.apache.http.Header... headers)
T - the type parameterclazz - the clazzurl - the urlheaders - the headersCopyright © 2019. All rights reserved.