Join Morten Rand-Hendriksen for an in-depth discussion in this video Request/response pairs, part of Learning REST APIs.
- [Instructor] All this theory is well and good;…but to really get REST APIs, you have to see one in action.…So in this chapter, I want to dig into the standard…request response pairs to show you how different types…of requests are made, what the responses look like…and, most importantly, what they do.…For these examples, I'll use my locally-hosted WordPress…site and the authorization header from the previous chapter.…Remember, requests and responses will vary…based on the configuration of the REST API you work with;…but the overall structure and behavior…will always be roughly the same.…
So while what you see here will not match…what you'll see interacting with other REST APIs,…the principles taught are the same.…The first step in working with a REST API is discovery.…For this, we'll use an options request.…In the WordPress REST API, the posts resource…is the resource collection for all the available…posts on the site; so let's start there.…I'll pass a request for options and then the posts resource.…This gives us a detailed breakdown of all the methods…
- What is a REST API?
- Who or what interacts with REST APIs?
- Anatomy of a REST request
- HTTP status messages
- Request/response pairs
- GET, POST, and DELETE