changes APIHandler attribute "dump" to "header" for clarity

This commit is contained in:
2026-02-10 14:52:50 +01:00
parent 5aa7527cca
commit 2117f61f36
3 changed files with 5 additions and 5 deletions

View File

@@ -9,7 +9,7 @@ class APIHandler:
'''Init method, apikey suggested but not required (empty by default).'''
self.auth = {"Authorization" : apikey}
self.content = {"Content-Type" : "application/json"}
self.dump = {**self.auth, **self.content}
self.header = {**self.auth, **self.content}
self.elaburl = ELABFTW_API_URL
def get_entry_from_elabid(self, elabid, entryType="items"):
'''
@@ -18,7 +18,7 @@ class APIHandler:
Entry type can be either "experiments" or "items".
'''
# TO-DO: validation and error handling on entryType value.
header = self.dump
header = self.header
response = requests.get(
headers = header,
url = f"{self.elaburl}/{entryType}/{elabid}",