changes APIHandler attribute "dump" to "header" for clarity
This commit is contained in:
@@ -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}",
|
||||
|
||||
Reference in New Issue
Block a user