Skip to Content
Hands-On RESTful Python Web Services - Second Edition
book

Hands-On RESTful Python Web Services - Second Edition

by Gastón C. Hillar
December 2018
Intermediate to advanced
500 pages
12h 33m
English
Packt Publishing
Content preview from Hands-On RESTful Python Web Services - Second Edition

Writing request handlers

The main building blocks for a RESTful API in Tornado are subclasses of the tornado.web.RequestHandler class, that is, the base class for HTTP request handlers in Tornado. We just need to perform the following tasks to build our RESTful API that interacts with a drone:

  1. Create a subclass of the RequestHandler class and declare the methods for each supported HTTP verb
  2. Override the methods to handle HTTP requests
  3. Map the URL patterns to each subclass of the RequestHandler superclass in the tornado.web.Application instance that represents the Tornado web application

We will create the following subclasses of the RequestHandler class:

Class name

Description

HexacopterHandler

This class processes the HTTP ...

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.
Start your free trial

You might also like

Building RESTful Python Web Services

Building RESTful Python Web Services

Gastón C. Hillar
Python Command Line Tools

Python Command Line Tools

Alfredo Deza, Noah Gift

Publisher Resources

ISBN: 9781789532227Supplemental Content