sess.auth = HTTPDigestAuth('*', '*')
sess.get(url)
headers = {'content-type': 'application/xml'}
with codecs.open('trb-1996-219.xml', 'r', 'utf-8') as xmlfile:
    sess.put(url, data=xmlfile, headers=headers)
Upload a large XML file with Python Requests library