Testing A Put API Using Restassured
Purpose of PUT
PUT requests update an existing resource, usually replacing it entirely with the data provided in the request body.
Example
given()
.contentType("application/json")
.body("{ \"name\": \"Asha\", \"job\": \"Lead QA\" }")
.when()
.put("https://reqres.in/api/users/2")
.then()
.statusCode(200)
.body("job", equalTo("Lead QA"));
What to Verify
Confirm the updated fields reflect the new values correctly, and that the status code confirms success (commonly 200 OK).
Ready to master real-world software testing?
Learn manual and automation testing hands-on with mentor-led sessions.
.png)