public abstract class ThirdPartySysHttpUtils extends Object
| 限定符和类型 | 类和说明 |
|---|---|
static class |
ThirdPartySysHttpUtils.TrustAllTrustManager
The type Trust all trust manager.
|
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
buildQuery(Map<String,String> params,
String charset)
Build query string.
|
static String |
buildRequestUrl(String url,
String... queries)
Build request url string.
|
static byte[] |
compressData(byte[] bytes)
Compress data byte [ ].
|
static String |
compressRequest(String requestUrl,
String requestMethod,
int connectTimeout,
int readTimeout,
String userData,
Map<String,String> headerMap,
int retryTimes)
Compress request string.
|
static String |
compressRequest(String requestUrl,
String requestMethod,
int connectTimeout,
int readTimeout,
String userData,
Map<String,String> headerMap,
String saveFilePath,
int retryTimes)
Compress request string.
|
static String |
decode(String value)
使用默认的UTF-8字符集反编码请求参数值。
|
static String |
decode(String value,
String charset)
使用指定的字符集反编码请求参数值。
|
static String |
encode(String value)
使用默认的UTF-8字符集编码请求参数值。
|
static String |
encode(String value,
String charset)
使用指定的字符集编码请求参数值。
|
protected static String |
getResponseAsString(HttpURLConnection conn)
Gets response as string.
|
static String |
getResponseCharset(String ctype)
Gets response charset.
|
static String |
getStreamAsString(InputStream stream,
String charset)
Gets stream as string.
|
static String |
request(String requestUrl,
String requestMethod,
int connectTimeout,
int readTimeout,
String userData,
Map<String,String> headerMap,
int retryTimes)
Request string.
|
static String |
request(String requestUrl,
String requestMethod,
int connectTimeout,
int readTimeout,
String userData,
Map<String,String> headerMap,
String saveFilePath,
int retryTimes)
Request string.
|
static void |
setLocal(Locale locale)
Sets local.
|
static Map<String,String> |
splitUrlQuery(String query)
从URL中提取所有的参数。
|
public static void setLocal(Locale locale)
locale - the localepublic static String request(String requestUrl, String requestMethod, int connectTimeout, int readTimeout, String userData, Map<String,String> headerMap, int retryTimes)
requestUrl - the request urlrequestMethod - the request methodconnectTimeout - the connect timeoutreadTimeout - the read timeoutuserData - the user dataheaderMap - the header mappublic static String compressRequest(String requestUrl, String requestMethod, int connectTimeout, int readTimeout, String userData, Map<String,String> headerMap, int retryTimes)
requestUrl - the request urlrequestMethod - the request methodconnectTimeout - the connect timeoutreadTimeout - the read timeoutuserData - the user dataheaderMap - the header mappublic static String request(String requestUrl, String requestMethod, int connectTimeout, int readTimeout, String userData, Map<String,String> headerMap, String saveFilePath, int retryTimes)
requestUrl - the request urlrequestMethod - the request methodconnectTimeout - the connect timeoutreadTimeout - the read timeoutuserData - the user dataheaderMap - the header mapsaveFilePath - the save file pathpublic static String compressRequest(String requestUrl, String requestMethod, int connectTimeout, int readTimeout, String userData, Map<String,String> headerMap, String saveFilePath, int retryTimes)
requestUrl - the request urlrequestMethod - the request methodconnectTimeout - the connect timeoutreadTimeout - the read timeoutuserData - the user dataheaderMap - the header mapsaveFilePath - the save file pathpublic static String buildRequestUrl(String url, String... queries)
url - the urlqueries - the queriespublic static String buildQuery(Map<String,String> params, String charset) throws IOException
params - the paramscharset - the charsetIOException - the io exceptionprotected static String getResponseAsString(HttpURLConnection conn) throws IOException
conn - the connIOException - the io exceptionpublic static String getStreamAsString(InputStream stream, String charset) throws IOException
stream - the streamcharset - the charsetIOException - the io exceptionpublic static String getResponseCharset(String ctype)
ctype - the ctypepublic static String decode(String value)
value - 参数值public static String encode(String value)
value - 参数值public static String decode(String value, String charset)
value - 参数值charset - 字符集public static String encode(String value, String charset)
value - 参数值charset - 字符集public static Map<String,String> splitUrlQuery(String query)
query - URL地址public static byte[] compressData(byte[] bytes)
throws IOException
bytes - the bytesIOException - the io exceptionCopyright © 2021. All rights reserved.