0
class MainHandler(tornado.web.RequestHandler):
@tornado.web.asynchronous
@tornado.gen.coroutine
def post(self):
pass
我发现龙卷风会在这种情况下
如何禁用它返回200龙卷风回报200。如何禁用空处理器
class MainHandler(tornado.web.RequestHandler):
@tornado.web.asynchronous
@tornado.gen.coroutine
def post(self):
pass
我发现龙卷风会在这种情况下
如何禁用它返回200龙卷风回报200。如何禁用空处理器
为了澄清,如果未明确设置响应代码或发生错误,Tornado将使用200。很难找出这种方法是“空的” - 只有通过,没有检查回溯,这是过度杀伤恕我直言。
因此,无论你设置状态码方法
class MainHandler(tornado.web.RequestHandler):
@tornado.gen.coroutine
def post(self):
self.set_status(501, 'Not implemented')
或删除完全post
方法,如果不使用它,客户会收到405不允许。
当使用'coroutine'时,'asynchonous'是多余的。 – kwarunek
@kwarunek谢谢 –