在发送正文时,我可以找到预订确认,但当我尝试打印响应时,会得到类似"io.restassured.internal.RestAssuredResponseImpl@268cbb86的响应。“
公共静态空main(String[]参数){
details();
bodyhashmap();
senddata();
System.out.println(body);
Response resp1=given().header("Content-Type","application/json")
.log()
.all()
.body(body)
.post("https://restful-booker.herokuapp.com/booking");
resp1.prettyPrint();
String as=resp1.jsonPath().get("firstname");
System.out.println(resp1.getBody().toString());
}}
发布于 2021-02-20 23:17:41
在这种情况下,方法toString()无效,请尝试改用resp1.getBody().asString()。
https://stackoverflow.com/questions/66270195
复制相似问题