Skip to content

Commit ec8c8ae

Browse files
authored
Merge pull request #20 from haohany/develop
bug fix
2 parents 583c8da + a801c7d commit ec8c8ae

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

ox3apiclient/__init__.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
API_PATH_V2 = '/ox/4.0'
4040
API_PATH_SSO = '/api'
4141
ACCEPTABLE_PATHS = (API_PATH_V1, API_PATH_V2, API_PATH_SSO)
42-
JSON_PATHS = (API_PATH_V2)
42+
JSON_PATHS = (API_PATH_V2,)
4343
HTTP_METHOD_OVERRIDES = ['DELETE', 'PUT', 'OPTIONS']
4444

4545

@@ -60,7 +60,7 @@ class Client(object):
6060
of Python dictionaries, translated to and from the JSON and
6161
query string encoding the API itself uses.
6262
63-
"""
63+
"""
6464

6565

6666
def __init__(self, domain, realm, consumer_key, consumer_secret,
@@ -92,7 +92,7 @@ def __init__(self, domain, realm, consumer_key, consumer_secret,
9292
headers -- list of headers to send with the request
9393
timeout -- http request timeout in seconds.
9494
"""
95-
95+
9696
self.domain = domain
9797
self.consumer_key = consumer_key
9898
self.consumer_secret = consumer_secret
@@ -103,7 +103,7 @@ def __init__(self, domain, realm, consumer_key, consumer_secret,
103103
self.authorization_url = authorization_url
104104
self.api_path = api_path
105105
self.timeout = timeout
106-
106+
107107
# Validate API path:
108108
if api_path not in ACCEPTABLE_PATHS:
109109
msg = '"{}" is not a recognized API path.'.format(api_path)
@@ -339,13 +339,13 @@ def get(self, url):
339339
return response.json()
340340
except:
341341
return response.content
342-
342+
343343
def options(self, url):
344344
"""Send a request with HTTP method OPTIONS to the given
345345
URL or API shorthand.
346-
346+
347347
OX3 v2 uses this method for showing help information.
348-
348+
349349
"""
350350
response = self._session.options(self._resolve_url(url), timeout=self.timeout)
351351
self.log_request(response)
@@ -389,7 +389,7 @@ def post(self, url, data=None):
389389

390390
def delete(self, url):
391391
"""Issue a DELETE request to the URL or API shorthand."""
392-
response = requests.delete(self._resolve_url(url))
392+
response = self._session.delete(self._resolve_url(url))
393393
self.log_request(response)
394394
response.raise_for_status()
395395
# Catch no content responses from some delete actions.

0 commit comments

Comments
 (0)