public class HTTPCall extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
HTTPCall.HTTPMETHOD |
| Modifier and Type | Field and Description |
|---|---|
protected String |
address |
static String |
APPLICATION_JSON_CHARSET_UTF_8 |
static String |
PARAM_EQUALS |
static String |
PARAM_SEPARATOR |
static String |
PARAM_STARTER |
static String |
PATH_SEPARATOR |
protected String |
userAgent |
static String |
UTF8 |
| Constructor and Description |
|---|
HTTPCall(String address,
String userAgent) |
| Modifier and Type | Method and Description |
|---|---|
<C> C |
call(Class<C> clz,
String path,
HTTPCall.HTTPMETHOD method) |
<C> C |
call(Class<C> clz,
String path,
HTTPCall.HTTPMETHOD method,
Map<String,? extends Object> parameters) |
protected <C> C |
call(Class<C> clz,
String path,
HTTPCall.HTTPMETHOD method,
Map<String,? extends Object> parameters,
String body) |
<C> C |
call(Class<C> clz,
String path,
HTTPCall.HTTPMETHOD method,
String body) |
protected HttpURLConnection |
getConnection(String path,
String urlParameters,
HTTPCall.HTTPMETHOD method,
String body) |
protected HttpURLConnection |
getConnection(URL url,
HTTPCall.HTTPMETHOD method,
String body) |
protected String |
getParametersDataString(Map<String,? extends Object> parameters) |
protected StringBuilder |
getStringBuilder(InputStream inputStream) |
protected URL |
getURL(String urlString) |
protected URL |
getURL(String address,
String path,
String urlParameters) |
public static final String APPLICATION_JSON_CHARSET_UTF_8
public static final String PATH_SEPARATOR
public static final String PARAM_STARTER
public static final String PARAM_EQUALS
public static final String PARAM_SEPARATOR
public static final String UTF8
protected final String address
protected final String userAgent
protected String getParametersDataString(Map<String,? extends Object> parameters) throws UnsupportedEncodingException
UnsupportedEncodingExceptionprotected URL getURL(String address, String path, String urlParameters) throws MalformedURLException
MalformedURLExceptionprotected URL getURL(String urlString) throws MalformedURLException
MalformedURLExceptionprotected HttpURLConnection getConnection(String path, String urlParameters, HTTPCall.HTTPMETHOD method, String body) throws Exception
Exceptionprotected HttpURLConnection getConnection(URL url, HTTPCall.HTTPMETHOD method, String body) throws Exception
Exceptionprotected StringBuilder getStringBuilder(InputStream inputStream) throws IOException
IOExceptionpublic <C> C call(Class<C> clz, String path, HTTPCall.HTTPMETHOD method) throws Exception
Exceptionpublic <C> C call(Class<C> clz, String path, HTTPCall.HTTPMETHOD method, Map<String,? extends Object> parameters) throws Exception
Exceptionpublic <C> C call(Class<C> clz, String path, HTTPCall.HTTPMETHOD method, String body) throws Exception
ExceptionCopyright © 2019. All Rights Reserved.