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,String> parameters) |
protected <C> C |
call(Class<C> clz,
String path,
HTTPCall.HTTPMETHOD method,
Map<String,String> 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 <C> ERAvailableInAnotherContextException |
getElementAvailableInAnotherContextException(Class<C> clz) |
protected <C> ERNotFoundException |
getElementNotFoundException(Class<C> clz) |
protected String |
getParametersDataString(Map<String,String> parameters) |
protected StringBuilder |
getStringBuilder(InputStream inputStream) |
protected URL |
getURL(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,String> parameters) throws UnsupportedEncodingException
UnsupportedEncodingExceptionprotected URL getURL(String path, String urlParameters) throws MalformedURLException
MalformedURLExceptionprotected HttpURLConnection getConnection(String path, String urlParameters, HTTPCall.HTTPMETHOD method, String body) throws Exception
Exceptionprotected StringBuilder getStringBuilder(InputStream inputStream) throws IOException
IOExceptionprotected <C> ERNotFoundException getElementNotFoundException(Class<C> clz) throws ERNotFoundException, ResourceRegistryException
protected <C> ERAvailableInAnotherContextException getElementAvailableInAnotherContextException(Class<C> clz)
public <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,String> parameters) throws Exception
Exceptionpublic <C> C call(Class<C> clz, String path, HTTPCall.HTTPMETHOD method, String body) throws Exception
ExceptionCopyright © 2017. All Rights Reserved.