Package | Description |
---|---|
cn.hutool.http |
Hutool-http针对JDK的HttpUrlConnection做一层封装,简化了HTTPS请求、文件上传、Cookie记忆等操作,使Http请求变得无比简单。
|
cn.hutool.http.server |
Http服务器封装
|
Modifier and Type | Method and Description |
---|---|
static Header |
Header.valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Header[] |
Header.values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
Modifier and Type | Method and Description |
---|---|
String |
HttpConnection.header(Header name)
获取Http请求头
|
String |
HttpBase.header(Header name)
根据name获取头信息
|
String |
GlobalHeaders.header(Header name)
根据name获取头信息
|
T |
HttpBase.header(Header name,
String value)
设置一个header
覆盖模式,则替换之前的值 |
GlobalHeaders |
GlobalHeaders.header(Header name,
String value)
设置一个header
覆盖模式,则替换之前的值 |
HttpConnection |
HttpConnection.header(Header header,
String value,
boolean isOverride)
设置请求头
当请求头存在时,覆盖之 |
T |
HttpBase.header(Header name,
String value,
boolean isOverride)
设置一个header
如果覆盖模式,则替换之前的值,否则加入到值列表中 |
GlobalHeaders |
GlobalHeaders.header(Header name,
String value,
boolean isOverride)
设置一个header
如果覆盖模式,则替换之前的值,否则加入到值列表中 |
T |
HttpBase.removeHeader(Header name)
移除一个头信息
|
GlobalHeaders |
GlobalHeaders.removeHeader(Header name)
移除一个头信息
|
Modifier and Type | Method and Description |
---|---|
String |
HttpServerRequest.getHeader(Header headerKey)
获得请求header中的信息
|
HttpServerResponse |
HttpServerResponse.setHeader(Header header,
String value)
设置响应头,如果已经存在,则覆盖
|
Copyright © 2024. All rights reserved.