类 HttpUtil
- java.lang.Object
-
- com.dss.sdk.utils.http.HttpUtil
-
public class HttpUtil extends Object
- 作者:
- Fadada 2021/9/8 16:09:38
-
-
字段概要
字段 修饰符和类型 字段 说明 static HttpConfighttpConfig
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static DssEntityResponsedownLoadFiles(String url, Map<String,String> reqHeader, String params)下载文件static DssResponseexecuteHttpRequest(org.apache.hc.client5.http.impl.classic.CloseableHttpClient client, org.apache.hc.client5.http.classic.methods.HttpUriRequest request, Map<String,String> reqHeader, RequestParametersHolder requestHolder)static DssResponseget(String url, Map<String,String> reqHeader, Map<String,String> params, RequestParametersHolder requestHolder)static org.apache.hc.client5.http.impl.classic.CloseableHttpClientgetHttpClient(HttpConfig httpConfig)获取clientstatic DssResponsepost(String url, Map<String,String> reqHeader, Object params, Map<String,FileItem> files, RequestParametersHolder requestHolder)post请求
-
-
-
字段详细资料
-
httpConfig
public static HttpConfig httpConfig
-
-
方法详细资料
-
post
public static DssResponse post(String url, Map<String,String> reqHeader, Object params, Map<String,FileItem> files, RequestParametersHolder requestHolder) throws ApiException
post请求- 参数:
url- 请求路径reqHeader- 请求报文params- 请求参数files- 请求文件- 抛出:
ApiException
-
get
public static DssResponse get(String url, Map<String,String> reqHeader, Map<String,String> params, RequestParametersHolder requestHolder) throws ApiException
- 抛出:
ApiException
-
downLoadFiles
public static DssEntityResponse downLoadFiles(String url, Map<String,String> reqHeader, String params) throws Exception
下载文件- 参数:
url- 请求路径reqHeader- 请求头params- 请求参数- 返回:
- ApiResponseEntity
- 抛出:
Exception
-
getHttpClient
public static org.apache.hc.client5.http.impl.classic.CloseableHttpClient getHttpClient(HttpConfig httpConfig) throws ApiException
获取client- 参数:
httpConfig- http配置- 返回:
- CloseableHttpClient client
- 抛出:
ApiException
-
executeHttpRequest
public static DssResponse executeHttpRequest(org.apache.hc.client5.http.impl.classic.CloseableHttpClient client, org.apache.hc.client5.http.classic.methods.HttpUriRequest request, Map<String,String> reqHeader, RequestParametersHolder requestHolder) throws ApiException
- 抛出:
ApiException
-
-