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 |
APPLICATION_XML_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 |
|---|---|
void |
call(String path,
HTTPCall.HTTPMETHOD method,
Map<String,String> parameters,
String contentType) |
protected void |
call(String path,
HTTPCall.HTTPMETHOD method,
Map<String,String> parameters,
String body,
String contentType) |
void |
call(String path,
HTTPCall.HTTPMETHOD method,
String contentType) |
void |
call(String path,
HTTPCall.HTTPMETHOD method,
String body,
String contentType) |
protected HttpURLConnection |
getConnection(String path,
String urlParameters,
HTTPCall.HTTPMETHOD method,
String body,
String contentType) |
protected HttpURLConnection |
getConnection(URL url,
HTTPCall.HTTPMETHOD method,
String body,
String contentType) |
protected String |
getParametersDataString(Map<String,String> 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 APPLICATION_XML_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 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, String contentType) throws Exception
Exceptionprotected HttpURLConnection getConnection(URL url, HTTPCall.HTTPMETHOD method, String body, String contentType) throws Exception
Exceptionprotected StringBuilder getStringBuilder(InputStream inputStream) throws IOException
IOExceptionpublic void call(String path, HTTPCall.HTTPMETHOD method, String contentType) throws Exception
Exceptionpublic void call(String path, HTTPCall.HTTPMETHOD method, Map<String,String> parameters, String contentType) throws Exception
Exceptionpublic void call(String path, HTTPCall.HTTPMETHOD method, String body, String contentType) throws Exception
ExceptionCopyright © 2017. All Rights Reserved.