def falcon(body, headers):
import falcon
path = '/hello/{account_id}/test'
falcon_app = falcon.API('text/plain')
# def ask(req, resp, params):
# params['answer'] = 42
# @falcon.before(ask)
class HelloResource:
def on_get(self, req, resp, account_id):
user_agent = req.user_agent # NOQA
limit = req.get_param('limit') or '10' # NOQA
resp.data = body
resp.set_headers(headers)
falcon_app.add_route(path, HelloResource())
return falcon_app
评论列表
文章目录