Add multipart form support. Does not yet handle additional post parameters correctly.
This commit is contained in:
parent
0ef3abe79e
commit
5858043d44
3 changed files with 43 additions and 5 deletions
|
@ -67,7 +67,9 @@ class ApiPhoto:
|
|||
return photo
|
||||
|
||||
def upload(self, photo_file, **kwds):
|
||||
raise NotImplementedError("Use upload_encoded instead.")
|
||||
result = self._client.post("/photo/upload.json", files={'photo': photo_file},
|
||||
**kwds)["result"]
|
||||
return Photo(self._client, result)
|
||||
|
||||
def upload_encoded(self, photo_file, **kwds):
|
||||
""" Base64-encodes and uploads the specified file """
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue