| 程序包 | 说明 |
|---|---|
| com.xiaoleilu.hutool.http |
| 限定符和类型 | 方法和说明 |
|---|---|
HttpConnection |
HttpConnection.connect()
连接
|
static HttpConnection |
HttpConnection.create(String urlStr,
Method method)
创建HttpConnection
|
HttpConnection |
HttpConnection.disableCache()
关闭缓存
|
HttpConnection |
HttpConnection.disconnect()
断开连接
|
HttpConnection |
HttpConnection.header(Header header,
String value,
boolean isOverride)
设置请求头
当请求头存在时,覆盖之 |
HttpConnection |
HttpConnection.header(Map<String,List<String>> headers)
设置请求头
不覆盖原有请求头 |
HttpConnection |
HttpConnection.header(String header,
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(String cookie)
设置Cookie
|
HttpConnection |
HttpConnection.setReadTimeout(int timeout)
设置读取超时
|
| 限定符和类型 | 方法和说明 |
|---|---|
static HttpResponse |
HttpResponse.readResponse(HttpConnection httpConnection)
读取响应信息
|
Copyright © 2016. All rights reserved.