Merge pull request #1803 from Tengah/issue-1802

Fixed configuration of host in api_client so that it gets done at run-time not load-time
This commit is contained in:
wing328 2016-01-04 15:19:07 +08:00
commit dee885e9f5

View File

@ -66,8 +66,7 @@ class ApiClient(object):
:param header_name: a header to pass when making calls to the API. :param header_name: a header to pass when making calls to the API.
:param header_value: a header value to pass when making calls to the API. :param header_value: a header value to pass when making calls to the API.
""" """
def __init__(self, host=Configuration().host, def __init__(self, host=None, header_name=None, header_value=None, cookie=None):
header_name=None, header_value=None, cookie=None):
""" """
Constructor of the class. Constructor of the class.
@ -76,7 +75,10 @@ class ApiClient(object):
self.default_headers = {} self.default_headers = {}
if header_name is not None: if header_name is not None:
self.default_headers[header_name] = header_value self.default_headers[header_name] = header_value
self.host = host if host is None:
self.host = Configuration().host
else:
self.host = host
self.cookie = cookie self.cookie = cookie
# Set default User-Agent. # Set default User-Agent.
self.user_agent = 'Python-Swagger/{{packageVersion}}' self.user_agent = 'Python-Swagger/{{packageVersion}}'