From the course: Learning REST APIs

Unlock the full course today

Join today to access over 24,000 courses taught by industry experts.

PUT/PATCH

PUT/PATCH

“

- [Narrator] Now that I've created a new resource through the REST API, I want to make a change to it. I want to change the title, cause I don't think the title fits exactly. Depending on how the REST API is set up, we could either use POST or PUT or PATCH to make this change because in some REST APIs, POST, PUT, or PATCH are exactly the same and in some REST APIs they are quite different. Now, the only way I can really figure out which tool to use is by going and asking the REST API itself. Over here on the left hand side we already have a GET request for the singleton resource 15. And to find out what I can do with this resource, I'll now again send an OPTIONS request. This will give me a full breakdown. And here you see we can send a GET, POST, PUT, PATCH, and DELETE requests. So I'll make a search and say PUT and when I go to the second entry you'll see that here in the Wordpress REST API the POST, PUT, and PATCH methods are actually treated as the same. So they all have the same…

Contents