Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
Always add tweet_mode to API requests
Browse files Browse the repository at this point in the history
  • Loading branch information
Eboreg committed Apr 29, 2020
1 parent a1fe9c8 commit 29647e6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,9 @@ violations.flake8.txt

# Built docs
doc/_build/**

# Mypy cache
**/.mypy_cache

# VS Code
**/.vscode
3 changes: 2 additions & 1 deletion twitter/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5107,6 +5107,8 @@ def _RequestUrl(self, url, verb, data=None, json=None, enforce_auth=True):
if not data:
data = {}

data['tweet_mode'] = self.tweet_mode

if verb == 'POST':
if data:
if 'media_ids' in data:
Expand All @@ -5122,7 +5124,6 @@ def _RequestUrl(self, url, verb, data=None, json=None, enforce_auth=True):
resp = 0 # POST request, but without data or json

elif verb == 'GET':
data['tweet_mode'] = self.tweet_mode
url = self._BuildUrl(url, extra_params=data)
resp = self._session.get(url, auth=self.__auth, timeout=self._timeout, proxies=self.proxies)

Expand Down

0 comments on commit 29647e6

Please sign in to comment.