@@ -7,11 +7,11 @@ def __init__(self, configuration):
77 self .configuration = configuration
88
99 def get (self , path , payload = {}):
10- r = requests .get (self .url (path ), params = self . data ( payload ) , headers = self .headers ())
10+ r = requests .get (self .url (path ), params = payload , headers = self .headers ())
1111 return self .handle_response (r )
1212
1313 def post (self , path , payload ):
14- r = requests .post (self .url (path ), json = self . data ( payload ) , headers = self .headers ())
14+ r = requests .post (self .url (path ), json = payload , headers = self .headers ())
1515 return self .handle_response (r )
1616
1717 def handle_response (self , r ):
@@ -30,9 +30,8 @@ def url(self, path):
3030 def protocol (self ):
3131 return 'https' if self .configuration .secure else 'http'
3232
33- def data (self , payload ):
34- payload .update ({ 'key' : self .configuration .api_key })
35- return payload
36-
3733 def headers (self ):
38- return { 'User-Agent' : self .configuration .user_agent }
34+ return {
35+ 'User-Agent' : self .configuration .user_agent ,
36+ 'Authorization' : 'Bearer ' + self .configuration .api_key ,
37+ }
0 commit comments