mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 11:23:58 +00:00
Update python sample code.
This commit is contained in:
parent
d4ac668cd4
commit
b4d4fa1a43
@ -63,7 +63,7 @@ class PetApi(object):
|
||||
bodyParam = None
|
||||
|
||||
headerParams['Accept'] = 'application/json,application/xml'
|
||||
headerParams['Content-Type'] = 'application/json,application/xml'
|
||||
headerParams['Content-Type'] = 'application/json,application/xml,'
|
||||
|
||||
|
||||
|
||||
@ -119,7 +119,7 @@ class PetApi(object):
|
||||
bodyParam = None
|
||||
|
||||
headerParams['Accept'] = 'application/json,application/xml'
|
||||
headerParams['Content-Type'] = 'application/json,application/xml'
|
||||
headerParams['Content-Type'] = 'application/json,application/xml,'
|
||||
|
||||
|
||||
|
||||
@ -370,7 +370,7 @@ class PetApi(object):
|
||||
bodyParam = None
|
||||
|
||||
headerParams['Accept'] = 'application/json,application/xml'
|
||||
headerParams['Content-Type'] = 'application/x-www-form-urlencoded'
|
||||
headerParams['Content-Type'] = 'application/x-www-form-urlencoded,'
|
||||
|
||||
|
||||
|
||||
@ -506,7 +506,7 @@ class PetApi(object):
|
||||
bodyParam = None
|
||||
|
||||
headerParams['Accept'] = 'application/json,application/xml'
|
||||
headerParams['Content-Type'] = 'multipart/form-data'
|
||||
headerParams['Content-Type'] = 'multipart/form-data,'
|
||||
|
||||
|
||||
|
||||
|
@ -34,6 +34,16 @@ class ApiClient(object):
|
||||
self.host = host
|
||||
self.cookie = None
|
||||
self.boundary = ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(30))
|
||||
# Set default User-Agent.
|
||||
self.user_agent = 'Python-Swagger'
|
||||
|
||||
@property
|
||||
def user_agent(self):
|
||||
return self.defaultHeaders['User-Agent']
|
||||
|
||||
@user_agent.setter
|
||||
def user_agent(self, value):
|
||||
self.defaultHeaders['User-Agent'] = value
|
||||
|
||||
def setDefaultHeader(self, headerName, headerValue):
|
||||
self.defaultHeaders[headerName] = headerValue
|
||||
|
Loading…
Reference in New Issue
Block a user