Merge pull request #425 from ping/mediaupload_status

Use GET request if the media upload command is STATUS
This commit is contained in:
Mike Helmick 2016-09-23 09:24:33 -04:00 committed by GitHub
commit a66268331b

View file

@ -143,6 +143,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):