public final class HttpUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
buildHttpErrorMessage(HttpURLConnection connection) |
static void |
closeConnection(HttpURLConnection connection) |
static String |
encodeQueryParam(String paramName,
String paramValue) |
static int |
getConnectTimeout() |
static int |
getReadTimeout() |
protected static HttpURLConnection |
openConnection(URL url,
String requestMethod,
Map<String,String> headers) |
static HttpURLConnection |
openDeleteConnection(URL url) |
static HttpURLConnection |
openPostConnection(URL url) |
static HttpURLConnection |
openPostConnection(URL url,
Map<String,String> headers) |
static String |
readBody(HttpURLConnection connection) |
static void |
setConnectTimeout(int connectTimeout) |
static void |
setReadTimeout(int readTimeout) |
public static String buildHttpErrorMessage(HttpURLConnection connection) throws IOException
IOExceptionpublic static HttpURLConnection openPostConnection(URL url) throws IOException
IOExceptionpublic static HttpURLConnection openPostConnection(URL url, Map<String,String> headers) throws IOException
IOExceptionpublic static HttpURLConnection openDeleteConnection(URL url) throws IOException
IOExceptionprotected static HttpURLConnection openConnection(URL url, String requestMethod, Map<String,String> headers) throws IOException
IOExceptionpublic static String readBody(HttpURLConnection connection) throws IOException
IOExceptionpublic static void closeConnection(HttpURLConnection connection)
public static int getConnectTimeout()
public static void setConnectTimeout(int connectTimeout)
public static int getReadTimeout()
public static void setReadTimeout(int readTimeout)
Copyright © 2017. All Rights Reserved.