public class HttpUtil extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static HttpConfig |
httpConfig |
| 限定符和类型 | 方法和说明 |
|---|---|
static BaseResponseEntity |
downLoadFiles(String url,
Map<String,String> reqHeader,
Map<String,String> params)
下载文件
|
static HttpInfoRes |
executeHttpRequest(org.apache.http.impl.client.CloseableHttpClient client,
org.apache.http.client.methods.HttpUriRequest request,
Map<String,String> reqHeader) |
static HttpInfoRes |
get(String url,
Map<String,String> reqHeader,
Map<String,String> params) |
static org.apache.http.impl.client.CloseableHttpClient |
getHttpClient(HttpConfig httpConfig)
获取client
|
static HttpInfoRes |
post(String url,
Map<String,String> reqHeader,
Map<String,String> params,
Map<String,File> files) |
public static HttpConfig httpConfig
public static HttpInfoRes post(String url, Map<String,String> reqHeader, Map<String,String> params, Map<String,File> files) throws ApiException
ApiExceptionpublic static org.apache.http.impl.client.CloseableHttpClient getHttpClient(HttpConfig httpConfig) throws ApiException
httpConfig - http配置ApiException - 异常public static HttpInfoRes get(String url, Map<String,String> reqHeader, Map<String,String> params) throws ApiException
ApiExceptionpublic static HttpInfoRes executeHttpRequest(org.apache.http.impl.client.CloseableHttpClient client, org.apache.http.client.methods.HttpUriRequest request, Map<String,String> reqHeader) throws ApiException
ApiExceptionpublic static BaseResponseEntity downLoadFiles(String url, Map<String,String> reqHeader, Map<String,String> params) throws ApiException
url - 请求路径reqHeader - 请求头params - 请求参数ApiException - 异常Copyright © 2025. All rights reserved.