In this lesson, we'll learn how to build a DSL expression request using the Given/When/Then methods.

We'll cover the following


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:

		.header("header2", "value2")

In the example above, before sending the POST request, headers(…), params(…) and body(…) are added to the request builder.

Example 2:


In this example, no extra information is added to the request builder before making a GET request.

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy