Updated to use requests and requests_oauthlib

To allow Python3 support.
Also removes quite a bit of multipart post magic.
This commit is contained in:
sneakypete81 2013-05-12 17:25:50 +01:00
parent 792632fdf4
commit 326394fed9
5 changed files with 46 additions and 78 deletions

View file

@ -80,7 +80,9 @@ class ApiPhoto:
return photo
def upload(self, photo_file, **kwds):
result = self._client.post("/photo/upload.json", files={'photo': photo_file},
result = self._client.post("/photo/upload.json",
files={'photo': (photo_file,
open(photo_file, 'rb'))},
**kwds)["result"]
return Photo(self._client, result)