def on_get(self, req, resp, account_id):
"""Handles GET requests"""
watched = Actions.get_watched(account_id)
if watched is None:
resp.status = falcon.HTTP_404
return
servers = Actions.get_servers(account_id)
resp.status = falcon.HTTP_200 # This is the default status
json_resp = {'account_id': account_id, 'watched': watched, 'servers': servers}
resp.body = json.dumps(json_resp)
评论列表
文章目录