Add support for some "forwarded" headers, included several new attributes and a reworking of some of the existing code to better facilitate sharing and performance. Also clean up a couple tiny nits in the docstrings for the sake of consistency.
37 lines
553 B
ReStructuredText
37 lines
553 B
ReStructuredText
.. _request:
|
|
|
|
Request & Response
|
|
==================
|
|
|
|
Instances of the Request and Response classes are passed into responders as the second
|
|
and third arguments, respectively.
|
|
|
|
.. code:: python
|
|
|
|
import falcon
|
|
|
|
|
|
class Resource(object):
|
|
|
|
def on_get(self, req, resp):
|
|
resp.body = '{"message": "Hello world!"}'
|
|
resp.status = falcon.HTTP_200
|
|
|
|
Request
|
|
-------
|
|
|
|
.. autoclass:: falcon.Request
|
|
:members:
|
|
|
|
.. autoclass:: falcon.Forwarded
|
|
:members:
|
|
|
|
Response
|
|
--------
|
|
|
|
.. autoclass:: falcon.Response
|
|
:members:
|
|
|
|
|
|
|