(self)
return post
The values of :attr:`forms` and :attr:`files` combined into a single
            :class:`FormsDict`. Values are either strings (form values) or
            instances of :class:`cgi.FieldStorage` (file uploads).
The values of :attr:`forms` and :attr:`files` combined into a single
            :class:`FormsDict`. Values are either strings (form values) or
            instances of :class:`cgi.FieldStorage` (file uploads).
The values of : attr : forms and : attr : files combined into a single : class : FormsDict . Values are either strings ( form values ) or instances of : class : cgi . FieldStorage ( file uploads ) .
def POST(self):
        """ The values of :attr:`forms` and :attr:`files` combined into a single
            :class:`FormsDict`. Values are either strings (form values) or
            instances of :class:`cgi.FieldStorage` (file uploads).
        """
        post = FormsDict()
        # We default to application/x-www-form-urlencoded for everything that
        # is not multipart and take the fast path (also: 3.1 workaround)
        if not self.content_type.startswith('multipart/'):
            pairs = _parse_qsl(tonat(self._get_body_string(), 'latin1'))
            for key, value in pairs:
                post[key] = value
            return post

        safe_env = {'QUERY_STRING':''} # Build a safe environment for cgi
        for key in ('REQUEST_METHOD', 'CONTENT_TYPE', 'CONTENT_LENGTH'):
            if key in self.environ: safe_env[key] = self.environ[key]
        args = dict(fp=self.body, environ=safe_env, keep_blank_values=True)
        if py31:
            args['fp'] = NCTextIOWrapper(args['fp'], encoding='utf8',
                                         newline='\n')
        elif py3k:
            args['encoding'] = 'utf8'
        data = cgi.FieldStorage(**args)
        self['_cgi.FieldStorage'] = data #http://bugs.python.org/issue18394#msg207958
        data = data.list or []
        for item in data:
            if item.filename:
                post[item.name] = FileUpload(item.file, item.name,
                                             item.filename, item.headers)
            else:
                post[item.name] = item.value
        return post
def POST ( self ) : post = FormsDict ( ) # We default to application/x-www-form-urlencoded for everything that # is not multipart and take the fast path (also: 3.1 workaround) if not self . content_type . startswith ( 'multipart/' ) : pairs = _parse_qsl ( tonat ( self . _get_body_string ( ) , 'latin1' ) ) for key , value in pairs : post [ key ] = value return post safe_env = { 'QUERY_STRING' : '' } # Build a safe environment for cgi for key in ( 'REQUEST_METHOD' , 'CONTENT_TYPE' , 'CONTENT_LENGTH' ) : if key in self . environ : safe_env [ key ] = self . environ [ key ] args = dict ( fp = self . body , environ = safe_env , keep_blank_values = True ) if py31 : args [ 'fp' ] = NCTextIOWrapper ( args [ 'fp' ] , encoding = 'utf8' , newline = '\n' ) elif py3k : args [ 'encoding' ] = 'utf8' data = cgi . FieldStorage ( * * args ) self [ '_cgi.FieldStorage' ] = data #http://bugs.python.org/issue18394#msg207958 data = data . list or [ ] for item in data : if item . filename : post [ item . name ] = FileUpload ( item . file , item . name , item . filename , item . headers ) else : post [ item . name ] = item . value return post