def get(self):
"""
Handle the READ-ONLY tasks operations.
Supported actions:
- get: Get the current status of tasks.
"""
action = self.get_argument("action", "get")
if action == "get":
response = {"status": self.status}
success = True
else:
# ERROR: bad action
success = False
reason = "Bad request action: {0}".format(action)
#
if success:
logger.debug("Response: {0}".format(response))
self.set_header("Content-Type", "application/json; charset=UTF-8")
self.write(json_encode(response))
else:
logger.warning("Request failed: {0}".format(reason))
self.send_error(400, reason=reason)
评论列表
文章目录