RestAssured Notes
RestAssured Notes
Demo
GET Request - https://reqres.in/api/users?page=2
Print response code, response body, response headers, and response time.
URL: https://reqres.in/api/users?page=2
Query Parameter: page=2
This means it fetches user data from the second page.
Expected Output:
package session03;
import org.testng.annotations.Test;
import io.restassured.RestAssured;
import io.restassured.response.Response;
@Test
public void test01() {
// Sending GET request
Response response = RestAssured.get("https://reqres.in/api/users?page=2");