'Put an object using Expect:100-continue'

def create_object_continue(self, container, object_name, data, metadata=None):

    headers = {}
    if metadata:
        for key in metadata:
            headers[str(key)] = metadata[key]
    headers['X-Auth-Token'] = self.token
    headers['content-length'] = (0 if (data is None) else len(data))
    headers['Expect'] = '100-continue'
    parsed = urlparse.urlparse(self.base_url)
    path = (str(parsed.path) + '/')
    path += ('%s/%s' % (str(container), str(object_name)))
    conn = create_connection(parsed)
    conn.putrequest('PUT', path)
    for (header, value) in headers.items():
        conn.putheader(header, value)
    conn.endheaders()
    response = conn.response_class(conn.sock, method=conn._method)
    (_, status, _) = response._read_status()
    response._safe_read(2)
    if (status != 100):
        conn.close()
        pattern = ('%s    %s' % ('Unexpected    http    success    status    code    {0}.', 'The    expected    status    code    is    {1}'))
        details = pattern.format(status, 100)
        raise exceptions.UnexpectedResponseCode(details)
    conn.send(data)
    resp = conn.getresponse()
    return (resp.status, resp.reason)
