diff options
Diffstat (limited to 'obsapi/httpapi.py')
| -rw-r--r-- | obsapi/httpapi.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/obsapi/httpapi.py b/obsapi/httpapi.py index ea0c9fb..6a207ec 100644 --- a/obsapi/httpapi.py +++ b/obsapi/httpapi.py @@ -52,10 +52,13 @@ class ObsHttpApi(object): url = '{0}{1}{2}'.format(self.apiurl, self.rootapi, api) + stream = params.pop('stream', False) + def try_get(): r = requests.get(url, auth=self.__auth, params=params, + stream=stream, verify=self.verify_ssl) self._response = r return r @@ -112,11 +115,14 @@ class ObsHttpApi(object): def get(self, *args, **params): binary_get = params.pop('binary_get', False) api = self.__api(*args) + stream = params.get('stream', False) r = self.__api_get(api, params=params) if not self.success: - return self.default_xml + return None if binary_get: + if stream: + return r return r.content return r.text |
