Chapter 12. Handling Actuator Requests

To change the state of a resource, a web client can send PUT requests. A PUT request contains a representation of the desired new state of the resource. In this chapter’s example, an LED’s state (on/off) is controlled through a web service, as illustrated in Figure 12-1.

Architecture of LedController
Figure 12-1. Architecture of LedController

LedController shows how to handle PUT requests; thus, it is a server program. Unfortunately, you cannot directly use a web browser as a client for sending PUT requests because web browsers are focused on GET requests. Later in this chapter you will see how you can write your own client program ...

Get Getting Started with the Internet of Things now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.