public class Response extends Object
| Constructor and Description |
|---|
Response() |
| Modifier and Type | Method and Description |
|---|---|
int |
getCode() |
Map |
getData()
直接获取服务端返回数据对象
|
<T> T |
getData(String jsonPath)
传入 jsonPath 查询服务端返回数据中的对应内容
|
<T> T |
getData(String jsonPath,
Class<T> type)
传入 jsonPath, type 限制查询服务端返回数据的内容类型
|
Map |
getHeaders() |
void |
setCode(int code) |
void |
setData(Map data) |
void |
setHeaders(Map headers) |
public int getCode()
public void setCode(int code)
public Map getHeaders()
public void setHeaders(Map headers)
public Map getData()
public <T> T getData(String jsonPath)
T - jsonPath - refer: https://github.com/json-path/JsonPath/edit/master/README.mdpublic <T> T getData(String jsonPath, Class<T> type)
T - jsonPath - refer: https://github.com/json-path/JsonPath/edit/master/README.mdtype - expected return type (will try to map)public void setData(Map data)
Copyright © 2020. All rights reserved.