Summary

In this chapter, we designed a RESTful API to interact with slow sensors and actuators. We defined the requirements for our API, understood the tasks performed by each HTTP method, and set up a virtual environment with Tornado.

We created the classes that represent a drone and wrote code to simulate slow I/O operations that are called for each HTTP request method, wrote classes that represent request handlers and process the different HTTP requests, and configured the URL patterns to route URLs to request handlers and their methods.

Finally, we started Tornado development server, used command-line tools to compose and send HTTP requests to our RESTful API, and analyzed how each HTTP requests was processed in our code. We also worked with GUI tools to compose and send HTTP requests.

Now that we understand the basics of Tornado to create RESTful APIs, we will take advantage of the non-blocking features combined with asynchronous operations in Tornado in a new version for the API, which is what we are going to discuss in the next chapter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.227.9