rhino.requestclass RequestRepresents an HTTP request built from a WSGI environment.
Class variables:
When True (the default), Request.input returns environ['wsgi.input'] wrapped in WsgiInput, to make it safe to call read() on it without providing the content length. This is required for servers like wsgiref.simple_server, which is also used by Rhino.mapper.start_server().
Some WSGI servers (e.g. gevent.pywsgi) provide a safe wsgi.input that also supports chunked encoding (a.k.a streamed uploads). To be able to benefit from this functionality, wrap_wsgi_input needs to be set to False. Alternatively, the original input file can always be found in Request.environ['wsgi.input'].
__init__(environ)bodyReads and returns the entire request body.
On first access, reads content_length bytes from input and stores the result on the request instance. On subsequent access, returns the cached value.
content_lengthThe value of the Content-Length header as an integer, or None
content_typeThe value of the Content-Type header, or None
formReads the request body and tries to parse it as a web form.
Parsing is done using the stdlib's cgi.FieldStorage class which supports multipart forms (file uploads). Returns a QueryDict instance holding the form fields. Uploaded files are represented as form fields with a 'filename' attribute.
inputReturns a file-like object representing the request body.
methodThe HTTP request method (verb).
path_infoThe PATH_INFO environment key as a unicode string.
queryA QueryDict instance holding the query parameters (QUERY_STRING).
remote_addrThe REMOTE_ADDR environment key
remote_portThe client's port number as an integer, or None (REMOTE_PORT).
routing_argsReturns named parameters extracted from the URL during routing.
schemeThe URL scheme, usually 'http' or 'https' (wsgi.url_scheme).
script_nameThe SCRIPT_NAME environment key as a unicode string.
server_nameThe SERVER_NAME environment key
server_portThe server's port number as an integer, or None (SERVER_PORT).
server_protocolThe SERVER_PROTOCOL environment key
urlThe reconstructed request URL (absolute).
url_for(*args, **kw)Build the URL for a target route.
The target is the first positional argument, and can be any valid target for Mapper.path, which will be looked up on the current mapper instance and used to build the URL for that route. Additionally, it can be one of:
Special keyword arguments:
_query_relativeAll other keyword arguments are treated as parameters for the URL template.
class RequestHeadersA dictionary-like object to access request headers.
Keys are case-insensitive. Accessing a header that is not present returns None instead of raising KeyError.
__init__(environ)class QueryDictA dictionary-like object to access query parameters.
Accessing a key returns the first value for that key. The keys(), values() and items() methods will return a key/value multiple times, if it is present multiple times in the query string.
The get_all() method can be used to return all values for a given key.
__init__(items)get_all(key)Return a list of values for the given key.
class WsgiInputRepresents a WSGI input filehandle that is safe to use read() on
__init__(rfile, content_length=None)