public class HttpClientUtils extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static HttpResponse |
doDelete(String url,
Map<String,String> params,
Map<String,String> headers)
delete k-v参数
|
static HttpResponse |
doDelete(String url,
Map<String,String> params,
Map<String,String> headers,
int timeoutSec) |
static HttpResponse |
doDelete(String url,
Map<String,String> params,
Map<String,String> headers,
int timeoutSec,
String proxyHost,
Integer proxyPort,
String proxyScheme) |
static HttpResponse |
doDeletedoPut(String url,
String bodyJsonParams,
Map<String,String> headers)
Delete json 参数
|
static HttpResponse |
doDeletedoPut(String url,
String bodyJsonParams,
Map<String,String> headers,
int timeoutSec) |
static HttpResponse |
doDeletedoPut(String url,
String bodyJsonParams,
Map<String,String> headers,
int timeoutSec,
String proxyHost,
Integer proxyPort,
String proxyScheme) |
static HttpResponse |
doGet(String url,
Map<String,String> params,
Map<String,String> headers)
get请求
|
static HttpResponse |
doGet(String url,
Map<String,String> params,
Map<String,String> headers,
int timeoutSec) |
static HttpResponse |
doGet(String url,
Map<String,String> params,
Map<String,String> headers,
int timeoutSec,
String responseCharset) |
static HttpResponse |
doGet(String url,
Map<String,String> params,
Map<String,String> headers,
int timeoutSec,
String proxyHost,
Integer proxyPort,
String proxyScheme) |
static HttpResponse |
doGetFile(String url,
Map<String,String> params,
Map<String,String> headers)
文件下载
|
static HttpResponse |
doGetFile(String url,
Map<String,String> params,
Map<String,String> headers,
Integer timeoutSec)
下载文件
|
static HttpResponse |
doGetImg(String url,
Map<String,String> params,
Map<String,String> headers)
已过时。
|
static HttpResponse |
doHeader(String url,
Map<String,String> headers)
head请求
|
static HttpResponse |
doHeader(String url,
Map<String,String> headers,
int timeoutSec) |
static HttpResponse |
doHeader(String url,
Map<String,String> headers,
int timeoutSec,
String proxyHost,
Integer proxyPort,
String proxyScheme) |
static HttpResponse |
doOptions(String url,
Map<String,String> params,
Map<String,String> headers)
options k-v参数
|
static HttpResponse |
doOptions(String url,
Map<String,String> params,
Map<String,String> headers,
int timeoutSec) |
static HttpResponse |
doOptions(String url,
Map<String,String> params,
Map<String,String> headers,
int timeoutSec,
String proxyHost,
Integer proxyPort,
String proxyScheme) |
static HttpResponse |
doOptions(String url,
String bodyJsonParams,
Map<String,String> headers)
options json参数
|
static HttpResponse |
doOptions(String url,
String bodyJsonParams,
Map<String,String> headers,
int timeoutSec) |
static HttpResponse |
doOptions(String url,
String bodyJsonParams,
Map<String,String> headers,
int timeoutSec,
String proxyHost,
Integer proxyPort,
String proxyScheme) |
static HttpResponse |
doPatch(String url,
Map<String,String> params,
Map<String,String> headers)
patch k-v参数
|
static HttpResponse |
doPatch(String url,
Map<String,String> params,
Map<String,String> headers,
int timeoutSec) |
static HttpResponse |
doPatch(String url,
Map<String,String> params,
Map<String,String> headers,
int timeoutSec,
String proxyHost,
Integer proxyPort,
String proxyScheme) |
static HttpResponse |
doPatch(String url,
String bodyJsonParams,
Map<String,String> headers)
patch json参数
|
static HttpResponse |
doPatch(String url,
String bodyJsonParams,
Map<String,String> headers,
int timeoutSec) |
static HttpResponse |
doPatch(String url,
String bodyJsonParams,
Map<String,String> headers,
int timeoutSec,
String proxyHost,
Integer proxyPort,
String proxyScheme) |
static HttpResponse |
doPost(String url,
Map<String,String> params,
Map<String,String> headers)
post k-v参数
|
static HttpResponse |
doPost(String url,
Map<String,String> params,
Map<String,String> headers,
int timeoutSec)
post k-v参数
|
static HttpResponse |
doPost(String url,
Map<String,String> params,
Map<String,String> headers,
int timeoutSec,
String proxyHost,
Integer proxyPort,
String proxyScheme)
POST K-V参数
|
static HttpResponse |
doPost(String url,
String bodyJsonParams,
Map<String,String> headers)
post请求 json参数
|
static HttpResponse |
doPost(String url,
String bodyJsonParams,
Map<String,String> headers,
int timeoutSec)
post请求 json参数
|
static HttpResponse |
doPost(String url,
String bodyJsonParams,
Map<String,String> headers,
int timeoutSec,
String proxyHost,
Integer proxyPort,
String proxyScheme)
POST请求,json参数
|
static HttpResponse |
doPut(String url,
Map<String,String> params,
Map<String,String> headers)
put k-v参数
|
static HttpResponse |
doPut(String url,
Map<String,String> params,
Map<String,String> headers,
int timeoutSec) |
static HttpResponse |
doPut(String url,
Map<String,String> params,
Map<String,String> headers,
int timeoutSec,
String proxyHost,
Integer proxyPort,
String proxyScheme) |
static HttpResponse |
doPut(String url,
String bodyJsonParams,
Map<String,String> headers)
PUT JSON参数
|
static HttpResponse |
doPut(String url,
String bodyJsonParams,
Map<String,String> headers,
int timeoutSec) |
static HttpResponse |
doPut(String url,
String bodyJsonParams,
Map<String,String> headers,
int timeoutSec,
String proxyHost,
Integer proxyPort,
String proxyScheme) |
static org.apache.http.client.HttpClient |
getHttpClient()
获取client
|
static String |
getRedirectURL(String url,
Map<String,String> headers)
获取重定向URL地址
|
public static org.apache.http.client.HttpClient getHttpClient()
throws IOException
IOExceptionpublic static HttpResponse doPost(String url, String bodyJsonParams, Map<String,String> headers, int timeoutSec) throws IOException
url - bodyJsonParams - headers - IOExceptionpublic static HttpResponse doPost(String url, String bodyJsonParams, Map<String,String> headers, int timeoutSec, String proxyHost, Integer proxyPort, String proxyScheme) throws IOException
url - bodyJsonParams - headers - timeoutSec - proxyHost - proxyPort - proxyScheme - IOExceptionpublic static HttpResponse doPost(String url, String bodyJsonParams, Map<String,String> headers) throws IOException
url - bodyJsonParams - headers - IOExceptionpublic static HttpResponse doPost(String url, Map<String,String> params, Map<String,String> headers, int timeoutSec) throws IOException
url - params - headers - IOExceptionpublic static HttpResponse doPost(String url, Map<String,String> params, Map<String,String> headers, int timeoutSec, String proxyHost, Integer proxyPort, String proxyScheme) throws IOException
url - params - headers - timeoutSec - proxyHost - proxyPort - proxyScheme - IOExceptionpublic static HttpResponse doPost(String url, Map<String,String> params, Map<String,String> headers) throws IOException
url - params - headers - IOExceptionpublic static HttpResponse doPatch(String url, String bodyJsonParams, Map<String,String> headers) throws IOException
url - bodyJsonParams - headers - IOExceptionpublic static HttpResponse doPatch(String url, String bodyJsonParams, Map<String,String> headers, int timeoutSec) throws IOException
IOExceptionpublic static HttpResponse doPatch(String url, String bodyJsonParams, Map<String,String> headers, int timeoutSec, String proxyHost, Integer proxyPort, String proxyScheme) throws IOException
IOExceptionpublic static HttpResponse doPatch(String url, Map<String,String> params, Map<String,String> headers) throws IOException
url - params - headers - IOExceptionpublic static HttpResponse doPatch(String url, Map<String,String> params, Map<String,String> headers, int timeoutSec) throws IOException
IOExceptionpublic static HttpResponse doPatch(String url, Map<String,String> params, Map<String,String> headers, int timeoutSec, String proxyHost, Integer proxyPort, String proxyScheme) throws IOException
IOExceptionpublic static HttpResponse doPut(String url, String bodyJsonParams, Map<String,String> headers) throws IOException
url - bodyJsonParams - headers - IOExceptionpublic static HttpResponse doPut(String url, String bodyJsonParams, Map<String,String> headers, int timeoutSec) throws IOException
IOExceptionpublic static HttpResponse doPut(String url, String bodyJsonParams, Map<String,String> headers, int timeoutSec, String proxyHost, Integer proxyPort, String proxyScheme) throws IOException
IOExceptionpublic static HttpResponse doPut(String url, Map<String,String> params, Map<String,String> headers) throws IOException
url - params - headers - IOExceptionpublic static HttpResponse doPut(String url, Map<String,String> params, Map<String,String> headers, int timeoutSec) throws IOException
IOExceptionpublic static HttpResponse doPut(String url, Map<String,String> params, Map<String,String> headers, int timeoutSec, String proxyHost, Integer proxyPort, String proxyScheme) throws IOException
IOExceptionpublic static HttpResponse doDeletedoPut(String url, String bodyJsonParams, Map<String,String> headers) throws IOException
url - bodyJsonParams - headers - IOExceptionpublic static HttpResponse doDeletedoPut(String url, String bodyJsonParams, Map<String,String> headers, int timeoutSec) throws IOException
IOExceptionpublic static HttpResponse doDeletedoPut(String url, String bodyJsonParams, Map<String,String> headers, int timeoutSec, String proxyHost, Integer proxyPort, String proxyScheme) throws IOException
IOExceptionpublic static HttpResponse doDelete(String url, Map<String,String> params, Map<String,String> headers) throws IOException
url - params - headers - IOExceptionpublic static HttpResponse doDelete(String url, Map<String,String> params, Map<String,String> headers, int timeoutSec) throws IOException
IOExceptionpublic static HttpResponse doDelete(String url, Map<String,String> params, Map<String,String> headers, int timeoutSec, String proxyHost, Integer proxyPort, String proxyScheme) throws IOException
IOExceptionpublic static HttpResponse doOptions(String url, String bodyJsonParams, Map<String,String> headers) throws IOException
url - bodyJsonParams - headers - IOExceptionpublic static HttpResponse doOptions(String url, String bodyJsonParams, Map<String,String> headers, int timeoutSec) throws IOException
IOExceptionpublic static HttpResponse doOptions(String url, String bodyJsonParams, Map<String,String> headers, int timeoutSec, String proxyHost, Integer proxyPort, String proxyScheme) throws IOException
IOExceptionpublic static HttpResponse doOptions(String url, Map<String,String> params, Map<String,String> headers) throws IOException
url - params - headers - IOExceptionpublic static HttpResponse doOptions(String url, Map<String,String> params, Map<String,String> headers, int timeoutSec) throws IOException
IOExceptionpublic static HttpResponse doOptions(String url, Map<String,String> params, Map<String,String> headers, int timeoutSec, String proxyHost, Integer proxyPort, String proxyScheme) throws IOException
IOExceptionpublic static HttpResponse doHeader(String url, Map<String,String> headers) throws IOException
url - headers - IOExceptionpublic static HttpResponse doHeader(String url, Map<String,String> headers, int timeoutSec) throws IOException
IOExceptionpublic static HttpResponse doHeader(String url, Map<String,String> headers, int timeoutSec, String proxyHost, Integer proxyPort, String proxyScheme) throws IOException
IOExceptionpublic static HttpResponse doGet(String url, Map<String,String> params, Map<String,String> headers) throws IOException
url - params - headers - IOExceptionpublic static HttpResponse doGet(String url, Map<String,String> params, Map<String,String> headers, int timeoutSec) throws IOException
IOExceptionpublic static HttpResponse doGet(String url, Map<String,String> params, Map<String,String> headers, int timeoutSec, String responseCharset) throws IOException
IOExceptionpublic static HttpResponse doGet(String url, Map<String,String> params, Map<String,String> headers, int timeoutSec, String proxyHost, Integer proxyPort, String proxyScheme) throws IOException
IOException@Deprecated public static HttpResponse doGetImg(String url, Map<String,String> params, Map<String,String> headers) throws IOException
url - params - headers - IOExceptionpublic static HttpResponse doGetFile(String url, Map<String,String> params, Map<String,String> headers) throws IOException
url - params - headers - IOExceptionpublic static HttpResponse doGetFile(String url, Map<String,String> params, Map<String,String> headers, Integer timeoutSec) throws IOException
url - 请求地址params - 参数列表headers - 请求头部timeoutSec - 超时秒数IOExceptionpublic static String getRedirectURL(String url, Map<String,String> headers) throws IOException
url - 重定向后的URL地址IOExceptionCopyright © 2021. All rights reserved.