[英]Rest assured extracting values in json response in java
How to extract names in the following response in rest assured using java?如何使用 java 在 rest 中提取以下响应中的名称?
{
"type": "students",
"values": [
{
"id": "123",
"name": "Raj"
},
{
"id": "456",
"name": "Rahul"
}
]
}
To get all names
:获取所有
names
:
Response res = ...;
List<String> names = res.jsonPath().getList("values.name");
System.out.println(names); //[Raj, Rahul]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.