Skip to content

Commit 847346b

Browse files
author
Thomas
committed
Merge branch 'master' of https://github.com/jagter/python-netbox
2 parents a54c65b + 404d069 commit 847346b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

netbox/connection.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
class NetboxConnection(object):
77

88
def __init__(self, ssl_verify=False, use_ssl=True, host=None, auth_token=None, auth=None,
9-
port=None, api_prefix=None):
9+
port=None, api_prefix=None, extra_headers=None):
1010
self.use_ssl = use_ssl
1111
self.host = host
1212
self.auth_token = auth_token
@@ -31,6 +31,9 @@ def __init__(self, ssl_verify=False, use_ssl=True, host=None, auth_token=None, a
3131
if auth and auth_token:
3232
raise ValueError('Only one authentication method is possible. Please use auth or auth_token')
3333

34+
if extra_headers:
35+
self.session.headers.update(extra_headers)
36+
3437
def __request(self, method, params=None, key=None, body=None, url=None):
3538

3639
if method is not 'GET':

0 commit comments

Comments
 (0)