Use GET request if the media upload command is STATUS

This commit is contained in:
ping 2016-06-22 22:20:26 +08:00
parent 2faa84629b
commit f7ddbcf414

View file

@ -142,6 +142,10 @@ class EndpointsMixin(object):
Docs:
https://dev.twitter.com/rest/reference/post/media/upload
"""
# https://dev.twitter.com/rest/reference/get/media/upload-status
if params and params.get('command', '') == 'STATUS':
return self.get('https://upload.twitter.com/1.1/media/upload.json', params=params)
return self.post('https://upload.twitter.com/1.1/media/upload.json', params=params)
def upload_video(self, media, media_type, size=None):