From the course: Java: Automated API Testing with REST Assured

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Making a PUT request

Making a PUT request - Java Tutorial

From the course: Java: Automated API Testing with REST Assured

Start my 1-month free trial

Making a PUT request

- [Instructor] Put requests allow you to update an existing resource within the system. For example, we can use this endpoint to update a given product. Let's create a new test method, and we'll call this one update product. Inside of here, let's go ahead and specify the endpoint. And let's define the body. Now inside of this body, we'll need the ID of the product that we want to update, the name, the description, the price, and the category ID. So let's check the database so that we can gather the information we need to make this update. So I'm going to the console tab, and I'm going to say select everything from products where name equals water bottle. And when we execute this, you notice all of the details are here. So we're just going to copy that into our body. So we can start with the ID. And we see that the ID is 19. And let's go ahead and add the name. And that is water bottle. And by the way, these don't…

Contents