| 程序包 | 说明 |
|---|---|
| cn.hutool.http |
Hutool-http针对JDK的HttpUrlConnection做一层封装,简化了HTTPS请求、文件上传、Cookie记忆等操作,使Http请求变得无比简单。
|
| 限定符和类型 | 方法和说明 |
|---|---|
HttpResponse |
HttpRequest.execute()
执行Reuqest请求
|
HttpResponse |
HttpRequest.execute(boolean isAsync)
执行Reuqest请求
|
HttpResponse |
HttpRequest.executeAsync()
异步请求
异步请求后获取的 HttpResponse 为异步模式,此时此对象持有Http链接(http链接并不会关闭),直调用获取内容方法为止 |
HttpResponse |
HttpResponse.sync()
同步
如果为异步状态,则暂时不读取服务器中响应的内容,而是持有Http链接的 InputStream。 |
| 构造器和说明 |
|---|
HttpInputStream(HttpResponse response)
构造
|
Copyright © 2019. All rights reserved.