mirror of
https://github.com/bckelley/tconnectsync.git
synced 2026-08-24 03:34:12 -05:00
requests version upgrade: explicitly pass data for get requests
This commit is contained in:
@@ -88,7 +88,7 @@ class AndroidApi:
|
||||
return {'Authorization': 'Bearer %s' % self.accessToken}
|
||||
|
||||
def _get(self, endpoint, query={}, **kwargs):
|
||||
r = self.session.get(self.BASE_URL + endpoint, query, headers={
|
||||
r = self.session.get(self.BASE_URL + endpoint, data=query, headers={
|
||||
'User-Agent': self.ANDROID_USER_AGENT,
|
||||
'Content-Type': 'application/json',
|
||||
**self.api_headers()
|
||||
|
||||
@@ -71,7 +71,7 @@ class ControlIQApi:
|
||||
return {'Authorization': 'Bearer %s' % self.accessToken, **base_headers()}
|
||||
|
||||
def _get(self, endpoint, query):
|
||||
r = self.session.get(self.BASE_URL + endpoint, query, headers=self.api_headers())
|
||||
r = self.session.get(self.BASE_URL + endpoint, data=query, headers=self.api_headers())
|
||||
|
||||
if r.status_code != 200:
|
||||
raise ApiException(r.status_code, "ControlIQ API HTTP %s response: %s" % (str(r.status_code), r.text))
|
||||
|
||||
@@ -22,13 +22,13 @@ class WS2Api:
|
||||
self.session = base_session()
|
||||
|
||||
def get(self, endpoint, query):
|
||||
r = self.session.get(self.BASE_URL + endpoint, query, headers=base_headers())
|
||||
r = self.session.get(self.BASE_URL + endpoint, data=query, headers=base_headers())
|
||||
if r.status_code != 200:
|
||||
raise ApiException(r.status_code, "WS2 API HTTP %s response: %s" % (str(r.status_code), r.text))
|
||||
return r.text
|
||||
|
||||
def get_jsonp(self, endpoint):
|
||||
r = self.session.get(self.BASE_URL + endpoint, {'callback': 'cb'}, headers=base_headers())
|
||||
r = self.session.get(self.BASE_URL + endpoint, data={'callback': 'cb'}, headers=base_headers())
|
||||
if r.status_code != 200:
|
||||
raise ApiException(r.status_code, "WS2 API HTTP %s response: %s" % (str(r.status_code), r.text))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user