diff --git a/yarn_api_client/base.py b/yarn_api_client/base.py index 92425fb..9e248b9 100644 --- a/yarn_api_client/base.py +++ b/yarn_api_client/base.py @@ -44,7 +44,7 @@ def request(self, api_path, method='GET', **kwargs): else: response = requests.request(method=method, url=api_endpoint, headers=headers, **kwargs) - if response.status_code == requests.codes.ok: + if response.status_code in (200, 202): return self.response_class(response) else: msg = 'Response finished with status: %s. Details: %s' % (response.status_code, response.text)