Summary
In this chapter, we designed a RESTful API to interact with slow sensors and actuators. We defined the requirements for our API and understood the tasks performed by each HTTP method. We set up a virtual environment with Tornado.
We created the classes that represent a drone and wrote code to simulate the slow I/O operations that are called for each HTTP request method. We wrote classes that represent request handlers and process the different HTTP requests, and we configured the URL patterns to route URLs to request handlers and their methods.
Finally, we started the Tornado development server and we used command-line tools to compose and send HTTP requests to our RESTful API, and analyzed how each HTTP request was processed in our ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access