In the last few posts, we learned how to create a new card using the POST request, how to fetch a card using the GET request, and how to update the card using the PUT request. In this post, we will wrap it all up by deleting the card using the DELETE request.
Working with DELETE requests is always a bit tricky as unlike other HTTP methods you cannot make multiple same requests as that might throw an error of “resource not found”. Let’s take a look at an example –
Therefore, when planning on writing your API tests, you need to structure your data in such a way where you get a new resource every time when you are deleting a resource (we will look into this in the upcoming posts).
I hope this video helped you out, let me know if you have any questions in the comments below!