Tornado – Request Handlers

In tornado,

  • tornado.web.RequestHandler maps URLs to subclasses and
  • tornado.web.Application class starts a server at the beginning with certain settings

For instance, in the example below:

  • When a HTTP GET request is made to, class Hello handles it & requests made to are catered by class User
  • A web form  is rendered to the user when the client browses (Http Get) to /user
  • When the client fills in the form and clicks on ‘Submit Query’, a HTTP POST request is generated on /user URL
  • This request is then served by the post() method of handler class ‘User’ and the message with username and designation is rendered on the browser


Form presented to the client



Response from web server

One thought on “Tornado – Request Handlers

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s