diff --git a/src/classes.py b/src/classes.py index 802c9b5..2a40696 100644 --- a/src/classes.py +++ b/src/classes.py @@ -6,10 +6,7 @@ class Header: '''Init method, apikey suggested but not required (empty by default).''' self.auth = {"Authorization" : apikey} self.content = {"Content-Type" : "application/json"} - def dump(self): - '''Dumps the header in form of a dictionary.''' - dump = {**self.auth, **self.content} - return dump + self.dump = {**self.auth, **self.content} if __name__=="__main__": head = Header("MyApiKey-123456789abcdef") diff --git a/src/main.py b/src/main.py index edacdd1..0e68e81 100644 --- a/src/main.py +++ b/src/main.py @@ -41,7 +41,6 @@ def get_sample_layers_data(elabid): return result apikey = getpass("Paste API key here: ") # consider replacing with .env file -header = Header(apikey) -header = header.dump() +header = Header(apikey).dump result = get_sample_layers_data(1108) # edit id at will in case of deletion of remote source print(json.dumps(result)) \ No newline at end of file