Package | Description |
---|---|
org.dromara.hutool.http.client |
HTTP请求客户端封装,请求过程如下:
Server
^ |
| v
Request Response
^ |
| v
ClientEngine
|
org.dromara.hutool.http.client.body |
请求体封装实现
|
org.dromara.hutool.http.client.engine.httpclient4 |
Apache HttpClient 4.x实现
文档见:https://hc.apache.org/httpcomponents-client-4.5.x/index.html |
org.dromara.hutool.http.client.engine.httpclient5 |
Apache HttpClient 5.1.x实现
文档见:https://hc.apache.org/httpcomponents-client-5.1.x/index.html |
org.dromara.hutool.http.client.engine.jdk |
基于JDK的HttpUrlConnection封装的HTTP客户端
|
org.dromara.hutool.http.client.engine.okhttp |
OKHttp3封装
文档见:https://square.github.io/okhttp/ |
Modifier and Type | Method and Description |
---|---|
ResponseBody |
Response.body()
获取响应体,包含服务端返回的内容和Content-Type信息
如果为HEAD、CONNECT、TRACE等方法无响应体,则返回 null |
Modifier and Type | Method and Description |
---|---|
ResponseBody |
ResponseBody.sync()
同步数据到内存,以bytes形式存储
|
Modifier and Type | Method and Description |
---|---|
ResponseBody |
HttpClient4Response.body() |
Modifier and Type | Method and Description |
---|---|
ResponseBody |
HttpClient5Response.body() |
Modifier and Type | Method and Description |
---|---|
ResponseBody |
JdkHttpResponse.body() |
Modifier and Type | Method and Description |
---|---|
ResponseBody |
OkHttpResponse.body() |
Copyright © 2025. All rights reserved.