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
IOException
public static HttpURLConnection openPostConnection(URL url) throws IOException
IOException
public static HttpURLConnection openPostConnection(URL url, Map<String,String> headers) throws IOException
IOException
public static HttpURLConnection openDeleteConnection(URL url) throws IOException
IOException
protected static HttpURLConnection openConnection(URL url, String requestMethod, Map<String,String> headers) throws IOException
IOException
public static String readBody(HttpURLConnection connection) throws IOException
IOException
public 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 © 2018. All rights reserved.