In HTTP, in order to make a successful request to the
server, the client needs to include four items:
URL (uniform resource locator)
Method
List of headers
Body
The following sections look at each of these items in
detail.
Uniform Resource Locator (URL)
An URL is similar to a house address in that it defines
the location where a service resides on the Internet. A
URL typically has four components, as shown in Figure
7-7:
Protocol
Server/host address
Resource
Parameters
Figure 7-7 Anatomy of an HTTP URL
These four components are shown in the Figure 7-7.
As you can see, the server or host address is the unique
server name, /api/rooms/livingroom defines a resource
to access, and lights?state=ON is the parameter to send
in order to take some action.