def specials(self, env): """ per-request special objects """ return lazydict ( _env = (lambda: env), )
def contentArgs(self, env): """ returns form data as a dict. if form data is not urlencoded, it returns a lazydict with one key: _content , which maps to whatever was in the body of the request. """ _content = ( lambda: env['wsgi.input'].read(int(env.get("CONTENT_LENGTH", 0)))) if ((env["REQUEST_METHOD"] == "POST") and (env.get( "CONTENT_TYPE", '') == 'application/x-www-form-urlencoded')): return RequestData(_content()) else: # @TODO: multipart/form-data return lazydict(_content=_content)
def contentArgs(self, env): """ returns form data as a dict. if form data is not urlencoded, it returns a lazydict with one key: _content , which maps to whatever was in the body of the request. """ _content = (lambda: env['wsgi.input'].read( int(env.get("CONTENT_LENGTH", 0)))) if ((env["REQUEST_METHOD"]=="POST") and (env.get("CONTENT_TYPE",'')=='application/x-www-form-urlencoded')): return RequestData(_content()) else: # @TODO: multipart/form-data return lazydict(_content = _content)
def specials(self, env): """ per-request special objects """ return lazydict(_env=(lambda: env), )