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,13 +9,13 @@ class Header:
'''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}
def get_entry_from_elabid(elabid, entryType="items"):
'''
Function which returns entrypoint data (as dictionary) from its elabid.
'''
header = Header(apikey).dump
header = Header(apikey).header
response = requests.get(
headers = header,
url = f"{ELABFTW_API_URL}/{entryType}/{elabid}",