public interface HttpResponse extends Closeable
| Modifier and Type | Method and Description |
|---|---|
InputStream |
body()
获取响应主体
|
<T> T |
bodyAsBean(Type type)
获取响应主体并转为对象
|
byte[] |
bodyAsBytes()
获取响应主体并转为字节数组
|
String |
bodyAsString()
获取响应主体并转为字符串
|
int |
code()
获取状态代码
|
Charset |
contentCharset()
获取内容字符集
|
default Charset |
contentEncoding()
Deprecated.
3.6
|
Long |
contentLength()
获取内容长度
|
String |
contentType()
获取内容类型
|
String |
cookie(String name)
获取饼值
|
Collection<String> |
cookieNames()
获取饼名
|
List<String> |
cookies()
获取小饼数组
|
List<String> |
cookies(String name)
获取饼值数组
|
HttpResponseException |
createError()
创建响应异常
|
String |
header(String name)
获取头值
|
Collection<String> |
headerNames()
获取头名
|
List<String> |
headers(String name)
获取头值数组
|
String |
message()
获取状态消息
|
Collection<String> headerNames()
Collection<String> cookieNames()
Long contentLength()
String contentType()
Charset contentCharset()
@Deprecated default Charset contentEncoding()
int code()
String message()
InputStream body()
byte[] bodyAsBytes()
throws IOException
IOExceptionString bodyAsString() throws IOException
IOException<T> T bodyAsBean(Type type) throws IOException
IOExceptionHttpResponseException createError()
Copyright © 2025. All rights reserved.