mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-11 21:57:56 +08:00
2.0
This commit is contained in:
@@ -244,6 +244,26 @@ public class HttpTool {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求数据
|
||||
*
|
||||
* @param url 请求url
|
||||
* @param form 请求数据
|
||||
* @param header header
|
||||
* @return 返回Response
|
||||
* @throws IOException
|
||||
*/
|
||||
public Response requestForResponse(String url, Map<String, ?> form, Map<String, String> header, HTTPMethod method) throws IOException {
|
||||
Request.Builder requestBuilder = buildRequestBuilder(url, form, method);
|
||||
// 添加header
|
||||
addHeader(requestBuilder, header);
|
||||
|
||||
Request request = requestBuilder.build();
|
||||
return httpClient
|
||||
.newCall(request)
|
||||
.execute();
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载文件
|
||||
*
|
||||
|
Reference in New Issue
Block a user