With the Requests module,its is only necessary to provide a file handle as opposed to the contents retrieved with .read():
from requests import post
files = {'file' : open('data.txt', 'rb')}
foo = post('http://http.org/post', files=files)
Filename, content_type and headers can also be set:...