public interface Response
| 限定符和类型 | 接口和说明 |
|---|---|
static interface |
Response.CallBack |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
acceptRanges()
是否支持分段下载
|
String |
body() |
byte[] |
bodyAsBytes()
返回字节数组
|
void |
bodyAsFile(Path file)
写入到文件里
|
com.alibaba.fastjson.JSONArray |
bodyAsJSONArray()
返回JSON数组
|
com.alibaba.fastjson.JSONObject |
bodyAsJSONObject()
返回JSON对象
|
BufferedInputStream |
bodyStream()
获取输入流
|
String |
charset()
获取编码格式
|
long |
contentLength()
获取大小
|
String |
contentType()
获取返回格式类型
|
HttpCookie |
cookie(String name)
获取Cookie信息
|
List<HttpCookie> |
cookieList() |
String |
filename()
获取文件名
|
boolean |
hasCookie(String name)
是否存在该Cookie
|
boolean |
hasCookieWithValue(String name,
String value)
是否存在该Cookie
|
boolean |
hasHeader(String name)
是否有该Header
|
boolean |
hasHeaderWithValue(String name,
String value)
是否存在该Header
|
String |
header(String name)
获取头部信息
|
Map<String,String> |
headers()
获取所有Header信息
|
com.alibaba.fastjson.JSONArray |
jsonpAsJSONArray()
解析jsonp返回JSON数组
|
com.alibaba.fastjson.JSONObject |
jsonpAsJSONObject()
解析jsonp返回JSON对象
|
Document |
parse() |
DocumentParser |
parser() |
ResponseMeta |
responseMeta()
获取返回元数据
|
int |
statusCode()
获取状态码
|
String |
statusMessage()
获取消息
|
String |
url()
获取返回网址
|
String url()
int statusCode()
String statusMessage()
String charset()
String contentType()
long contentLength()
String filename()
boolean acceptRanges()
boolean hasHeader(String name)
boolean hasCookie(String name)
HttpCookie cookie(String name)
List<HttpCookie> cookieList()
String body() throws IOException
IOExceptioncom.alibaba.fastjson.JSONObject bodyAsJSONObject()
throws IOException
IOExceptioncom.alibaba.fastjson.JSONArray bodyAsJSONArray()
throws IOException
IOExceptioncom.alibaba.fastjson.JSONObject jsonpAsJSONObject()
throws IOException
IOExceptioncom.alibaba.fastjson.JSONArray jsonpAsJSONArray()
throws IOException
IOExceptionbyte[] bodyAsBytes()
throws IOException
IOExceptionvoid bodyAsFile(Path file) throws IOException
IOExceptionBufferedInputStream bodyStream()
Document parse() throws IOException
IOExceptionDocumentParser parser() throws IOException
IOExceptionResponseMeta responseMeta()
Copyright © 2020. All rights reserved.