Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow http_session to be provided to the client. #247

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions intercom/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@

class Client(object):

def __init__(self, personal_access_token='my_personal_access_token'):
def __init__(self, personal_access_token='my_personal_access_token', http_session=None):
self.personal_access_token = personal_access_token
self.base_url = 'https://api.intercom.io'
self.rate_limit_details = {}
self.http_session = requests.Session()
if http_session:
self.http_session = http_session
else:
self.http_session = requests.Session()

@property
def _auth(self):
Expand Down