Given/When/Then
Explore the use of given, when, and then methods in REST Assured to build request specifications, send HTTP requests, and validate responses. This lesson helps you construct API test scripts with proper headers, parameters, and body content for automation.
given()
It is used in building the DSL expression request with any additional information like headers, params, message body, authentication, etc., before making any HTTP Request like POST, GET, PUT, DELETE using given() method.
Example 1:
RestAssured.given()
.header("header1","value1")
.header("header2", ...