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 |
CONTENT_TYPE_APPLICATION_JSON_CHARSET_UTF_8 |
static String |
CONTENT_TYPE_APPLICATION_XML_CHARSET_UTF_8 |
static String |
CONTENT_TYPE_TEXT_PLAIN |
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) |
public static final String CONTENT_TYPE_APPLICATION_JSON_CHARSET_UTF_8
public static final String CONTENT_TYPE_APPLICATION_XML_CHARSET_UTF_8
public static final String CONTENT_TYPE_TEXT_PLAIN
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(String path, String urlParameters, HTTPCall.HTTPMETHOD method, InputStream inputStream, String contentType) throws Exception
Exceptionprotected HttpURLConnection getConnection(URL url, HTTPCall.HTTPMETHOD method, InputStream inputStream, 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, Map<String,String> parameters, String contentType) throws Exception
Exceptionpublic void call(String path, HTTPCall.HTTPMETHOD method, String body, String contentType) throws Exception
Exceptionprotected void call(String path, HTTPCall.HTTPMETHOD method, Map<String,String> parameters, String body, String contentType) throws Exception
Exceptionpublic void call(String path, HTTPCall.HTTPMETHOD method, InputStream inputStream, Map<String,String> parameters, String contentType) throws Exception
ExceptionCopyright © 2018. All Rights Reserved.