Passing Base Url, Headers, Body data, Method type & Endpoint Of API In Restassured
Base URI
given().baseUri("https://api.example.com")
Headers
.header("Authorization", "Bearer " + token)
Body Data
.body("{\"name\":\"Asha\"}")
Method Type & Endpoint
.when().post("/users")
Putting It Together
Combining these elements builds a complete, precisely configured request that mirrors exactly what a real client application would send to the API.
Ready to master real-world software testing?
Learn manual and automation testing hands-on with mentor-led sessions.