New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added create_metadata endpoint #460
Conversation
…mpty and the status code is not 204. If params is not a dictionary, _transparent_params is not called
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing up your code in this new pull request. Can you adjust your code to the changes in my review? Thanks!
twython/api.py
Outdated
try: | ||
if response.status_code == 204: | ||
content = response.content | ||
else: | ||
content = response.json() | ||
except ValueError: | ||
raise TwythonError('Response was not valid JSON. \ | ||
Unable to decode.') | ||
if response.content!="": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make this line:
if response.content != ''
(spaces around operator and single quotes
twython/api.py
Outdated
@@ -192,15 +196,16 @@ def _request(self, url, method='GET', params=None, api_call=None): | |||
error_message, | |||
error_code=response.status_code, | |||
retry_after=response.headers.get('X-Rate-Limit-Reset')) | |||
|
|||
content="" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
content = ''
Space around operators and single quotes
twython/api.py
Outdated
@@ -140,7 +140,11 @@ def _request(self, url, method='GET', params=None, api_call=None): | |||
params = params or {} | |||
|
|||
func = getattr(self.client, method) | |||
params, files = _transparent_params(params) | |||
if type(params) is dict: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make this if isinstance(params, dict)
Thanks! |
I have added the create_metadata endpoint for image descriptions. Now it should pass all tests. The following modifications have been made to api.py: