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:
parent
792632fdf4
commit
326394fed9
5 changed files with 46 additions and 78 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue