Automating PUT Request using Rest Assured
In the previous post, we learned about Automating POST Request by sending object in the body of the request. I would highly recommend to read the previous tutorials before proceeding with this one. In the current post, we will study about Automating PUT request by using Rest Assured. PUT request puts a file or resource at a precise URI, and exactly at that URI. If there's already a file or resource at that URI, PUT replaces that file or resource. If there is no file or resource there, PUT creates one. PUT request is used to update the existing records. In the body we can send string as well as Java object. But we always send Java object in body. The db.json file before sending the PUT request is a follows: Now let's see an example of sending PUT Request using Rest Assured. import com.restapiclass.Posts ; import io.restassured.RestAssured ; import io.restassured.http.ContentType ; import static io. restassured . RestAssured .*; import org...