本文整理匯總了Python中tornado.web.RequestHandler.SUPPORTED_METHODS屬性的典型用法代碼示例。如果您正苦於以下問題:Python RequestHandler.SUPPORTED_METHODS屬性的具體用法?Python RequestHandler.SUPPORTED_METHODS怎麽用?Python RequestHandler.SUPPORTED_METHODS使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類tornado.web.RequestHandler
的用法示例。
在下文中一共展示了RequestHandler.SUPPORTED_METHODS屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: other
# 需要導入模塊: from tornado.web import RequestHandler [as 別名]
# 或者: from tornado.web.RequestHandler import SUPPORTED_METHODS [as 別名]
def other(self):
# Even though this method exists, it won't get called automatically
# because it is not in SUPPORTED_METHODS.
self.write('other')
示例2: __init__
# 需要導入模塊: from tornado.web import RequestHandler [as 別名]
# 或者: from tornado.web.RequestHandler import SUPPORTED_METHODS [as 別名]
def __init__(self, path, methods, handler, options={}):
self.path = path
self.handler = handler
self.options = options
self.methods = []
if methods == "any":
self.methods = []
else:
for method in methods:
method = method.upper()
if method in self.SUPPORTED_METHODS:
self.methods.append(method)