rhino.responseclass ResponseRepresents an HTTP response.
Class attributes:
__init__(code, headers=None, body='')Create a new HTTP response.
Parameters:
a value for the response body. The body is only validated when the request is finalized (in __call__).
Valid values for the response body are:
add_callback(fn)Add a callback to be executed when the response is closed.
bodyThe response body.
codeThe HTTP status code as an integer.
conditional_to(request)Return a response that is conditional to a given request.
Returns the Response instance unchanged, or a new Response instance with a "304 Not Modified" status code.
headersA wsgiref.headers.Headers instance.
statusThe status line as a string (status code + reason)
class EntityRepresents a response body with entity headers.
__init__(body, **kw)response(code, body='', etag=None, last_modified=None, expires=None, **kw)Helper to build an HTTP response.
Parameters:
Response.__init__ for details.
body as argument and should return a string (quotes will be added to the returned string as described above).
x_powered_by => X-Powered-By).
ok(body='', code=200, **kw)Shortcut for response(200, ...).
The status code must be in the 2xx range.
created(body='', **kw)Shortcut for response(201, ...).
no_content(**kw)Shortcut for response(204, body='', ...).
redirect(location, code=302, **kw)Shortcut for response(302, location=location, ...)
The status code must be in the 3xx range.