路由设置:
(r'/status', index.StatusHandler)
代码:
from tornado.web import RequestHandler class StatusHandler(RequestHandler): def get(self): #使用非正常状态码时。必须写解释,本例的解释是:hahaha self.set_status(999,"hahah") self.write("ceshi")
2024-04-08 16:46:10
路由设置:
(r'/status', index.StatusHandler)
代码:
from tornado.web import RequestHandler class StatusHandler(RequestHandler): def get(self): #使用非正常状态码时。必须写解释,本例的解释是:hahaha self.set_status(999,"hahah") self.write("ceshi")