public final class HttpUtil extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static Map<String,String> |
buildHeaderMap(String filePath)
构建文件头信息
|
static void |
download(String remoteUrl,
String localUrl)
将远程的文件下载到本地
|
static void |
download(String remoteUrl,
String localUrl,
Map<String,String> headerMap)
将远程的文件下载到本地
|
static String |
getRequest(String requestUrl)
http get 请求
|
static String |
postRequest(String requestUrl)
http post 请求
|
static String |
request(String requestUrl,
String requestMethod)
http 请求
|
static String |
request(String requestUrl,
String requestMethod,
Map<String,String> headerMap)
http 请求
|
static String |
request(String requestUrl,
String requestMethod,
String charset,
Map<String,String> headerMap)
http 请求
|
public static String getRequest(String requestUrl)
requestUrl - 请求地址public static String postRequest(String requestUrl)
requestUrl - 请求地址public static String request(String requestUrl, String requestMethod)
requestUrl - 请求地址requestMethod - 方法public static String request(String requestUrl, String requestMethod, Map<String,String> headerMap)
requestUrl - 请求地址requestMethod - 方法headerMap - 头信息public static String request(String requestUrl, String requestMethod, String charset, Map<String,String> headerMap)
requestUrl - 请求地址requestMethod - 方法charset - 流编码headerMap - 头信息public static Map<String,String> buildHeaderMap(String filePath)
filePath - 文件路径public static void download(String remoteUrl, String localUrl)
remoteUrl - 远程的 urllocalUrl - 本地 urlCopyright © 2024. All rights reserved.