Files
deb-python-falcon/doc/api/request_and_response.rst

514 B

Req & Resp

Instances of the Request and Response classes are passed into responders as the second and third arguments, respectively.

import falcon


class Resource(object):

    def on_get(self, req, resp):
        resp.body = '{"message": "Hello world!"}'
        resp.status = falcon.HTTP_200

Request Class

falcon.Request

Response Class

falcon.Response