Skip to content

Commit

Permalink
refactor(nbia): use headers property instead of api_header attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
jjjermiah committed Jan 27, 2024
1 parent fe9a82b commit c3b0940
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/nbiatoolkit/nbia.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __init__(self,
"Setting up OAuth2 client... with username %s", username)

self._oauth2_client = OAuth2(username=username, password=password)
self.api_headers = self._oauth2_client.getToken()
self._api_headers = self._oauth2_client.getToken()

@property
def headers(self):
Expand All @@ -56,7 +56,7 @@ def query_api(self, endpoint: NBIA_ENDPOINTS, params: dict = {}) -> dict:
try:
response = requests.get(
url=query_url,
headers=self.api_headers,
headers=self.headers,
params=params
)
if response.headers.get('Content-Type') == 'application/json':
Expand Down

0 comments on commit c3b0940

Please sign in to comment.