result = requests.post(url,
data={'file': open('plot.jpg', 'rb')},
headers={
"Authorization": "OAuth " + token,
"Content-Type": "image/jpeg",
})
url = 'http://api-fotki.yandex.ru/api/users/' + login + '/photos/'
img = open(filename, 'rb')
result = requests.post(url,
files={'image': img},
headers=
{
"Authorization": "OAuth " + token,
"Accept": "application/json"
}
)