Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Tornado - Hello World
## Torando Web Server hello World
import tornado.ioloop
import tornado.web
class Hello(tornado.web.RequestHandler):
def get(self):
self.write("Hello, world")
application = tornado.web.Application([
(r"/", Hello),
if __name__ == "__main__":
## Request to Torando Web server Hello World
import httplib2
h = httplib2.Http()
resp, content = h.request("", "GET")
print "Reponse:", resp, "\nContent:", content
Reponse: {'status': '200', 'content-length': '12', 'content-location': '', 'server': 'TornadoServer/2.2',
'etag': '"e02aa1b106d5c7c6a98def2b13005d5b84fd8dc8"', 'content-type': 'text/html; charset=UTF-8'}
Content: Hello, world
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment