Skip to content

Commit

Permalink
Add new header
Browse files Browse the repository at this point in the history
  • Loading branch information
Danniel Hugo committed Nov 10, 2016
1 parent 276776e commit 4c0742b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gerencianet/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ def send(self, settings, params, body):
'Authorization': 'Bearer {token}'.format(token=self.token['access_token'])
}

if 'partner_token' in self.options:
headers['partner_token'] = self.options['partner_token']

return requests.request(settings['method'], url, json=body, headers=headers)

def authenticate(self):
Expand All @@ -60,6 +63,9 @@ def authenticate(self):
'api-sdk': 'python-{v}'.format(v=VERSION),
}

if 'partner_token' in self.options:
headers['partner_token'] = self.options['partner_token']

auth = (self.options['client_id'], self.options['client_secret'])
auth_body = {'grant_type': 'client_credentials'}

Expand Down

0 comments on commit 4c0742b

Please sign in to comment.