The library is requestsdesigned to store things like this simply:
import requests
r = requests.post('http://server/myapp/method', data={'aaa': 'bbb'})
Or depending on how the receiving party expects data:
import requests
r = requests.post('http://server/myapp/method',
data=file('binary_data_file.bin','rb').read())
source
share