| 程序包 | 说明 |
|---|---|
| org.ladsn.tool.http |
Hutool-http针对JDK的HttpUrlConnection做一层封装,简化了HTTPS请求、文件上传、Cookie记忆等操作,使Http请求变得无比简单。
|
| 限定符和类型 | 方法和说明 |
|---|---|
HttpConnection |
HttpConnection.connect()
连接
|
static HttpConnection |
HttpConnection.create(java.lang.String urlStr,
Method method)
创建HttpConnection
|
static HttpConnection |
HttpConnection.create(java.lang.String urlStr,
Method method,
javax.net.ssl.HostnameVerifier hostnameVerifier,
javax.net.ssl.SSLSocketFactory ssf)
创建HttpConnection
|
static HttpConnection |
HttpConnection.create(java.lang.String urlStr,
Method method,
javax.net.ssl.HostnameVerifier hostnameVerifier,
javax.net.ssl.SSLSocketFactory ssf,
int timeout,
java.net.Proxy proxy)
创建HttpConnection
|
static HttpConnection |
HttpConnection.create(java.lang.String urlStr,
Method method,
int timeout)
创建HttpConnection
|
static HttpConnection |
HttpConnection.create(java.net.URL url,
Method method,
javax.net.ssl.HostnameVerifier hostnameVerifier,
javax.net.ssl.SSLSocketFactory ssf,
int timeout,
java.net.Proxy proxy)
创建HttpConnection
|
HttpConnection |
HttpConnection.disableCache()
关闭缓存
|
HttpConnection |
HttpConnection.disconnect()
断开连接
|
HttpConnection |
HttpConnection.header(Header header,
java.lang.String value,
boolean isOverride)
设置请求头
当请求头存在时,覆盖之 |
HttpConnection |
HttpConnection.header(java.util.Map<java.lang.String,java.util.List<java.lang.String>> headerMap,
boolean isOverride)
设置请求头
不覆盖原有请求头 |
HttpConnection |
HttpConnection.header(java.lang.String header,
java.lang.String value,
boolean isOverride)
设置请求头
当请求头存在时,覆盖之 |
HttpConnection |
HttpConnection.initConn()
初始化连接相关信息
|
HttpConnection |
HttpConnection.setChunkedStreamingMode(int blockSize)
采用流方式上传数据,无需本地缓存数据。
|
HttpConnection |
HttpConnection.setConnectionAndReadTimeout(int timeout)
设置连接和读取的超时时间
|
HttpConnection |
HttpConnection.setConnectTimeout(int timeout)
设置连接超时
|
HttpConnection |
HttpConnection.setCookie(java.lang.String cookie)
设置Cookie
|
HttpConnection |
HttpConnection.setInstanceFollowRedirects(boolean isInstanceFollowRedirects)
设置自动HTTP 30X跳转
|
HttpConnection |
HttpConnection.setMethod(Method method)
设置请求方法
|
HttpConnection |
HttpConnection.setReadTimeout(int timeout)
设置读取超时
|
| 构造器和说明 |
|---|
HttpResponse(HttpConnection httpConnection,
java.nio.charset.Charset charset,
boolean isAsync,
boolean isIgnoreBody)
构造
|
Copyright © 2018. All rights reserved.