def post(self):
"""
Example Handler for an `HTTP POST <http://en.wikipedia.org/wiki/POST_(HTTP)>`_
request. Doesn't actually do anything.
"""
# If data is POSTed to this handler via an XMLHTTPRequest send() it
# will show up like this:
#posted_as_a_whole = self.request.body # xhr.send()
# If data was POSTed as arguments (i.e. traditional form) it will show
# up as individual arguments like this:
#posted_as_argument = self.get_argument("arg") # Form elem 'name="arg"'
# This is how you can parse JSON:
#parsed = tornado.escape.json_decode(posted_as_an_argument)
json_output = {'result': 'Success!'}
self.write(json_output)
# You'd put self.finish() here if post() was wrapped with tornado's
# asynchronous decorator.
# WebSocket actions (aka commands or "functions that are exposed")
评论列表
文章目录