Package wtf :: Package app :: Module request :: Class Request
[hide private]
[frames] | no frames]

Class Request

source code

object --+
         |
        Request

Request object passed to the application
Instance Methods [hide private]
 
_PORTMATCH(...)
Host:port matching function
source code
 
__init__(self, environ)
Initialization
source code
any
__getattr__(self, name)
Resolve unknown attributes
source code
str
remote_addr(self, check_proxy=False)
Determine the remote address
source code
wtf.webutil.URL
abs_uri(self, url, decode=None)
Determine absolute URI out of a (possibly) path only one
source code
D[k] if k in D, else d
_PORTS(D, k, d=...)
Default port mapping accessor for http and https
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  _cookie = None
Instance Variables [hide private]
ParameterWrapper _param = None
Request parameter store
dict env
WSGI environment
regex match match = None
URL regex match or None, filled from outside
Properties [hide private]
ParameterWrapper param
The request parameters (Query string or POST data)
CookieCollection cookie
The cookies
tuple basic_auth
Credentials of HTTP basic authentication
bool is_ssl
Is the request is SSL enabled?
str method
The request method

Inherited from object: __class__

Method Details [hide private]

_PORTMATCH(...)

source code 
Host:port matching function

__init__(self, environ)
(Constructor)

source code 
Initialization
Parameters:
  • environ (dict) - WSGI environment
Overrides: object.__init__

__getattr__(self, name)
(Qualification operator)

source code 

Resolve unknown attributes

We're looking for special env variables inserted by the middleware stack: wtf.request.<name>. These are expected to be factories, which are lazily initialized with the request object and return the actual attribute, which is cached in the request object for further use.

Parameters:
  • name (str) - The name to look up
Returns: any
The attribute in question
Raises:
  • AttributeError - Attribute could not be resolved

remote_addr(self, check_proxy=False)

source code 
Determine the remote address
Parameters:
  • check_proxy (bool) - Check for X-Forwarded-For?
Returns: str
The remote address

abs_uri(self, url, decode=None)

source code 
Determine absolute URI out of a (possibly) path only one
Parameters:
Returns: wtf.webutil.URL
The expanded URL

Property Details [hide private]

param

The request parameters (Query string or POST data)

This property is lazily initialized on first request.

Get Method:
unreachable.fget(self)
Type:
ParameterWrapper

cookie

The cookies

This property is lazily initialized on first request.

Get Method:
unreachable.fget(self)
Type:
CookieCollection

basic_auth

Credentials of HTTP basic authentication

(username, password) tuple or (None, None)

Get Method:
unreachable.fget(self)
Type:
tuple

is_ssl

Is the request is SSL enabled?
Get Method:
unreachable.fget(self)
Type:
bool

method

The request method
Get Method:
unreachable.fget(self)
Type:
str