From the course: Learning REST APIs

Unlock the full course today

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

DELETE

DELETE

From the course: Learning REST APIs

Start my 1-month free trial

DELETE

- [Instructor] At this point you've seen how to discover all the functionality of a REST API using options, how to get resource collections and singleton resources using get, how to create resources using post, and how to modify resources using put and patch. And that brings us to the inevitable conclusion: How to remove resources? If I want to remove a resource, I cans send a delete request to it. This delete request must be sent to the singleton resource URI to be successful, and here again, I need the proper authorization header, otherwise I won't be able to delete anything. The request itself is really simple, just delete, then the URI to the resource, singleton resource in this case, and an authorization header. Now, before I run this request, consider this: I'm sending a delete request to a REST API telling to delete the resource. What do you think happens? Let me show you. Over here, on the live WordPress site, you can see this is the post I want to delete. It's currently…

Contents