def on_get(self, req, resp, **kwargs):
"""GET responder.
Captures `req`, `resp`, and `kwargs`. Also sets up a sample response.
Args:
req: Falcon ``Request`` instance.
resp: Falcon ``Response`` instance.
kwargs: URI template *name=value* pairs, if any, along with
any extra args injected by middleware.
"""
# Don't try this at home - classes aren't recreated
# for every request
self.req, self.resp, self.kwargs = req, resp, kwargs
self.called = True
resp.status = falcon.HTTP_200
resp.body = self.sample_body
resp.set_headers(self.resp_headers)
评论列表
文章目录