public class OkHttpResponse extends Object implements Response
Response 响应包装| Constructor and Description |
|---|
OkHttpResponse(okhttp3.Response rawRes,
Charset requestCharset) |
| Modifier and Type | Method and Description |
|---|---|
InputStream |
bodyStream()
获得服务区响应流
流获取后处理完毕需关闭此类 |
Charset |
charset()
获取字符集编码,默认为响应头中的编码
|
void |
close() |
int |
getStatus()
获取状态码
|
String |
header(String name)
根据name获取头信息
根据RFC2616规范,header的name不区分大小写 |
Map<String,List<String>> |
headers()
获取headers
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitbody, bodyBytes, bodyStr, contentEncoding, contentLength, getCookieStr, getFileNameFromDisposition, header, headerList, isChunked, isOk, thenpublic OkHttpResponse(okhttp3.Response rawRes,
Charset requestCharset)
rawRes - ResponserequestCharset - 请求时的默认编码public int getStatus()
Responsepublic String header(String name)
Responsepublic Map<String,List<String>> headers()
Responsepublic InputStream bodyStream()
ResponsebodyStream in interface Responsepublic void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2024. All rights reserved.