Extracting Data Using Json Path Methods code example

Example: Extracting Data Using Json Path Methods

Response response =
                given()
                        .log().all()
//                        .baseUri("http://www.omdbapi.com")
                        .queryParam("apikey","26aa5b74")
                        .queryParam("t","Boss Baby").
                when()
                        .get("http://www.omdbapi.com");
// the JsonPath is a class that have a lot of methods
// to get the body data in different format or data types
// we get object by calling themethod of Response object called .jsonPath()
        JsonPath jp = response.jsonPath();
        // get the title as String
        String title = jp.getString("Title") ;