(self)
return u'\r\n'.join(lines)
Renders the headers for this request field.
Renders the headers for this request field.
Renders the headers for this request field .
def render_headers(self):
        """
        Renders the headers for this request field.
        """
        lines = []

        sort_keys = ['Content-Disposition', 'Content-Type', 'Content-Location']
        for sort_key in sort_keys:
            if self.headers.get(sort_key, False):
                lines.append(u'%s: %s' % (sort_key, self.headers[sort_key]))

        for header_name, header_value in self.headers.items():
            if header_name not in sort_keys:
                if header_value:
                    lines.append(u'%s: %s' % (header_name, header_value))

        lines.append(u'\r\n')
        return u'\r\n'.join(lines)
def render_headers ( self ) : lines = [ ] sort_keys = [ 'Content-Disposition' , 'Content-Type' , 'Content-Location' ] for sort_key in sort_keys : if self . headers . get ( sort_key , False ) : lines . append ( u'%s: %s' % ( sort_key , self . headers [ sort_key ] ) ) for header_name , header_value in self . headers . items ( ) : if header_name not in sort_keys : if header_value : lines . append ( u'%s: %s' % ( header_name , header_value ) ) lines . append ( u'\r\n' ) return u'\r\n' . join ( lines )