changes Header.dump from method to attribute
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user