py::qo::backend::POSTRequest Class Reference

List of all members.

Public Member Functions

def __init__
def addFileContent

Public Attributes

 buffer
 header

Static Public Attributes

string name = "POST"

Private Member Functions

def __append_line
def __bound_start
def __bound_end

Private Attributes

 __boundary


Member Function Documentation

def py::qo::backend::POSTRequest::__init__ (   self  ) 

00038                              :
00039                 self.__boundary = mimetools.choose_boundary()
00040                 self.buffer = ''
00041                 self.header = {
00042                         "Content-Type" : "multipart/form-data; boundary=%s" % self.__boundary,
00043                 }
00044 
        def __append_line( self, line = "" ) :

def py::qo::backend::POSTRequest::__append_line (   self,
  line = "" 
) [private]

00045                                              :
00046                 self.buffer += line + '\r\n'
00047 
        def __bound_start( self ) :

def py::qo::backend::POSTRequest::__bound_start (   self  )  [private]

00048                                   :
00049                 self.__append_line( '--%s' % self.__boundary )
        def __bound_end( self ):

def py::qo::backend::POSTRequest::__bound_end (   self  )  [private]

00050                                :
00051                 self.__append_line()
00052                 self.__append_line( '--%s--' % self.__boundary )
00053                 self.__append_line()
00054 
        def addFileContent( self, varname, filename, filecontent, mimetype = 'text/xml', encoding = 'utf-8' ) :

def py::qo::backend::POSTRequest::addFileContent (   self,
  varname,
  filename,
  filecontent,
  mimetype = 'text/xml',
  encoding = 'utf-8' 
)

00055                                                                                                               :
00056                 self.__bound_start()
00057                 self.__append_line( 'Content-Disposition: form-data; name="%s"; filename="%s"' % ( varname, filename ) )
00058                 if encoding is not None :
00059                         self.__append_line( 'Content-Type: %s; charset=%s' % ( mimetype, encoding ) )
00060                 else :
00061                         self.__append_line( 'Content-Type: %s' % mimetype )
00062                 self.__append_line( 'Content-Length: %d' % len( filecontent ) )
00063                 self.__append_line()
00064                 self.buffer += filecontent
00065                 self.__bound_end()
00066 
00067 
class BackendRequest :


Member Data Documentation

string py::qo::backend::POSTRequest::name = "POST" [static]

py::qo::backend::POSTRequest::__boundary [private]

py::qo::backend::POSTRequest::buffer

py::qo::backend::POSTRequest::header


The documentation for this class was generated from the following file:
Generated on Tue Oct 9 20:40:30 2007 for Qomics by  doxygen 1.5.3