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.
PreviousUnderstanding Restassured BDD Method- Given, When,Then
Next Testing A Get API Using Restassured
Ready to master real-world software testing?
Learn manual and automation testing hands-on with mentor-led sessions.
.png)