Skip to content
This repository was archived by the owner on Mar 30, 2023. It is now read-only.

Commit 6e2e98f

Browse files
author
Jason Costello
committed
Using response.ok attribute
1 parent 180fcf5 commit 6e2e98f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hypervector/resources/abstract/api_resource.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ def get_headers(cls):
2020
def get(cls, uuid):
2121
endpoint = f'{hypervector.API_BASE}/{cls.resource_name}/{uuid}'
2222
response = requests.get(endpoint, headers=cls.get_headers())
23-
if response.status_code == 200:
23+
if response.ok:
2424
return cls.from_get(response)
2525
else:
2626
raise HypervectorError(response)
2727

2828
@classmethod
2929
def request(cls, endpoint, method=requests.get):
3030
response = method(url=endpoint, headers=cls.get_headers())
31-
if response.status_code == 200:
31+
if response.ok:
3232
return response.json()
3333
else:
3434
raise HypervectorError(response)

0 commit comments

Comments
 (0)