ulif.openoffice.util – Utilities and Tools

ulif.openoffice.util.encode_multipart_formdata(fields, files)

fields is a sequence of (name, value) elements for regular form fields.

files is a sequence of (name, filename, value) elements for data to be uploaded as files

Return (content_type, body) ready for httplib.HTTP instance

ulif.openoffice.util.get_content_type(filename)

Try to guess content-type of a file.

Returns a MIME type as string.

If none can be determined, application/octet-stram is returned.

ulif.openoffice.util.post_multipart(host, selector, fields, files)

Post fields and files to an http host as multipart/form-data.

fields is a sequence of (name, value) elements for regular form fields.

files is a sequence of (name, filename, value) elements for data to be uploaded as files

Return the server’s response page.

Previous topic

ulif.openoffice.restserver – A RESTful PyUNO server

Next topic

CHANGES

This Page