Getting familiar with HTTP
Because APIs are designed to be used in code, in order to work with them, you do need to know a bit more about the HTTP protocol than you do for just accessing websites. So, in this section, you'll learn some HTTP basics.
For starters, HTTP is a request-response protocol. So, a client (the requesting system) makes a request to a server (the receiving system), which then responds to the client. The client references the server and the resource being requested using a Uniform Resource Identifier (URI).
Uniform resource identifiers
An HTTP URI provides the details needed to make an HTTP request to a specific server for a specific resource. To illustrate, let's break down the http://api.open-notify.org/astros.json endpoint that we looked at previously in the Understanding APIs section. The endpoint begins with a reference to the protocol used. In our example, this is http://
. For web-based APIs, this will always either be HTTP or HTTPS. When...