(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/'):
            maxlen = max(0, min(self.content_length, self.MEMFILE_MAX))
            pairs = _parse_qsl(tonat(self.body.read(maxlen), 'latin1'))
            for key, value in pairs[:self.MAX_PARAMS]:
                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='ISO-8859-1',
                                         newline='\n')
        elif py3k:
            args['encoding'] = 'ISO-8859-1'
        data = FieldStorage(**args)
        for item in (data.list or [])[:self.MAX_PARAMS]:
            post[item.name] = item if item.filename else 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/' ) : maxlen = max ( 0 , min ( self . content_length , self . MEMFILE_MAX ) ) pairs = _parse_qsl ( tonat ( self . body . read ( maxlen ) , 'latin1' ) ) for key , value in pairs [ : self . MAX_PARAMS ] : 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 = 'ISO-8859-1' , newline = '\n' ) elif py3k : args [ 'encoding' ] = 'ISO-8859-1' data = FieldStorage ( * * args ) for item in ( data . list or [ ] ) [ : self . MAX_PARAMS ] : post [ item . name ] = item if item . filename else item . value return post