| 程序包 | 说明 |
|---|---|
| cn.luues.tool.http |
Hutool-http针对JDK的HttpUrlConnection做一层封装,简化了HTTPS请求、文件上传、Cookie记忆等操作,使Http请求变得无比简单。
|
| 限定符和类型 | 方法和说明 |
|---|---|
String |
HttpResponse.body()
获取响应主体
|
private HttpResponse |
HttpResponse.init()
初始化Http响应
初始化包括: 1、读取Http状态 2、读取头信息 3、持有Http流,并不关闭流 |
private HttpResponse |
HttpResponse.initWithDisconnect()
初始化Http响应,并在报错时关闭连接。
|
HttpConnection |
HttpConnection.setHttpsInfo(HostnameVerifier hostnameVerifier,
SSLSocketFactory ssf)
设置https请求参数
有些时候htts请求会出现com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl的实现,此为sun内部api,按照普通http请求处理 |
Copyright © 2023. All rights reserved.