Did I find the right examples for you? yes no

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)

        def encode_multipart(data, files_data, boundary=BOUNDARY):
    lines = []

    for key, value in data.items():
        lines.extend(['--' + boundary,
                     'Content-Disposition: form-data; name="%s"' % str(key),
                      '',
                      str(value)])
    for key, value in files_data.items():
        lines.extend(encode_file(key, value, boundary))

    lines.extend(['--' + boundary + '--', '',])
    return '\r\n'.join(lines)
        


src/v/i/vimeo-xbmc-plugin-HEAD/plugin/vimeo/httplib2wrap/__init__.py   vimeo-xbmc-plugin(Download)
 
import httplib2
from multipart import encode_multipart, BOUNDARY
 
class Http(httplib2.Http):
        """
        if body_files:
            body = encode_multipart(body, body_files)
            headers["Content-type"] = \
                    "multipart/form-data; boundary=%s" % BOUNDARY