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.

GET

GET

From the course: Learning REST APIs

Start my 1-month free trial

GET

- [Instructor] To get the data from a resource, we send a get request and that means if we want the data from the posts resource, or the last 10 posts in this blog, we'll send a get request to the resource. Just like with options, we don't need to send an authorization header here, but we might as well since we have it, we get all our options. When I send this request, the rest API returns to me a list of the 10 most recent posts on the site. Each of these posts is structured as a nested JSON object. So here you can see the first one is post with "id":4, this is the publishing date, and the modified date, then we have the URL slug, we have the current status of the post, the type of post, the link to the post, this is the regular human readable link to the post, then we have the title, the content and so on. And as we scroll down, you see that this post is complete. That's because in the case of Word Press we get the full data for each of the posts even in the posts resource. So if…

Contents