This commit is contained in:
tanghc
2019-09-02 19:37:22 +08:00
parent 0cafb5829b
commit e47cd0e002
8 changed files with 197 additions and 24 deletions

View File

@@ -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();
}
/**
* 下载文件
*