Reputation: 11
When sending the body i can able to find the booking confirmation ,but when i try to print the response getting like "io.restassured.internal.RestAssuredResponseImpl@268cbb86 "
public static void main(String[] args) {
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());
}
}
Upvotes: 0
Views: 2112
Reputation: 547
Method toString()
is not valid in this case, try to use resp1.getBody().asString()
instead.
Upvotes: 2