3. How Does Your API Work? Flashcards
What are the two parts that every HTTP request and response have?
The headers and the payload.
What is a HTTP request or response’s payload?
HTML, JSON, XML…
What range of HTTP response codes indicate that the request was successful?
2xx
What does the 2xx HTTP response code series indicate?
That the request was successful.
What does the HTTP response code 200 mean?
It simply means “OK.”
What does the HTTP response code 201 mean?
It means “Created.”
What does the HTTP response code 202 mean and what is it used for?
It means “Accepted.” It’s used for identifying that the action the user just performed is underway, but it’s not complete yet.
What does the HTTP response code 204 mean, and when is it primarily used?
It means “No Content.” It’s primarily used when deleting a resource.
What does the 3xx HTTP response code series indicate?
That the resource has been moved from its original URL.
What does the HTTP response code 301 mean?
It means “Moved Permanently” as in what you’re looking for is no longer available here. Most responsible APIs will then give you the URL to then retrieve it.
What does the HTTP response code 302 mean?
It means “Moved Temporarily.”
What does the 4xx HTTP response code series indicate?
That a client error has occurred.
What does the HTTP response code 400 mean and what does it indicate?
It means “Bad Request,” denoting that the most recent attempt failed due to the client itself.
What does the HTTP response code 401 mean and what does it indicate?
It means “Unauthorized,” which indicates that the required authentication credentials were not provided or the authentication has failed.
What does the HTTP response code 403 mean and what does it indicate?
It means “Forbidden,” which indicates that the user making the request is not authorized to access the API point that’s being requested.
What does the HTTP response code 403 mean and what does it indicate?
It means “Not Found,” which indicates that the resource you’re looking for does not exist.