Package | Description |
---|---|
org.dromara.hutool.http |
Hutool-http针对JDK的HttpUrlConnection做一层封装,简化了HTTPS请求、文件上传、Cookie记忆等操作,使Http请求变得无比简单。
|
org.dromara.hutool.http.client |
HTTP请求客户端封装,请求过程如下:
Server
^ |
| v
Request Response
^ |
| v
ClientEngine
|
org.dromara.hutool.http.client.body |
请求体封装实现
|
org.dromara.hutool.http.client.engine |
Http客户端引擎实现
|
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/ |
org.dromara.hutool.http.webservice |
Webservice客户端封装实现
|
Modifier and Type | Method and Description |
---|---|
static Response |
HttpUtil.send(Request request)
使用默认HTTP引擎,发送HTTP请求
|
Modifier and Type | Method and Description |
---|---|
static String |
HttpUtil.toString(Response response)
打印
Response 为可读形式 |
Modifier and Type | Method and Description |
---|---|
Response |
Request.send()
发送请求
|
Response |
Request.send(ClientEngine engine)
发送请求
|
Response |
Response.sync()
同步
如果为异步状态,则暂时不读取服务器中响应的内容,而是持有Http链接的 InputStream 。 |
Modifier and Type | Method and Description |
---|---|
default void |
Response.then(Consumer<Response> consumer)
链式处理结果
|
Constructor and Description |
---|
ResponseBody(Response response,
InputStream in)
构造,不读取响应体,忽略响应体EOF错误
|
ResponseBody(Response response,
InputStream in,
boolean isAsync,
boolean isIgnoreEOFError)
构造
|
Modifier and Type | Method and Description |
---|---|
Response |
ClientEngine.send(Request message)
发送HTTP请求
|
Modifier and Type | Class and Description |
---|---|
class |
HttpClient4Response
HttpClient响应包装
通过包装 CloseableHttpResponse ,实现获取响应状态码、响应头、响应体等内容 |
Modifier and Type | Method and Description |
---|---|
Response |
HttpClient4Engine.send(Request message) |
Modifier and Type | Class and Description |
---|---|
class |
HttpClient5Response
HttpClient响应包装
通过包装 CloseableHttpResponse ,实现获取响应状态码、响应头、响应体等内容 |
Modifier and Type | Method and Description |
---|---|
Response |
HttpClient5Engine.send(Request message) |
Modifier and Type | Class and Description |
---|---|
class |
JdkHttpResponse
Http响应类
非线程安全对象 |
Modifier and Type | Class and Description |
---|---|
class |
OkHttpResponse
OkHttp3的
Response 响应包装 |
Modifier and Type | Method and Description |
---|---|
Response |
OkHttpEngine.send(Request message) |
Modifier and Type | Method and Description |
---|---|
Response |
SoapResponse.getHttpResponse()
获取原始HTTP响应
|
Response |
SoapClient.sendForResponse()
发送请求,获取异步响应
|
Constructor and Description |
---|
SoapResponse(Response response,
jakarta.xml.soap.MessageFactory factory)
构造
|
Copyright © 2025. All rights reserved.