diff --git a/samples/client/petstore/python/client/PetApi.py b/samples/client/petstore/python/client/PetApi.py index 519e2ea777..729431a811 100644 --- a/samples/client/petstore/python/client/PetApi.py +++ b/samples/client/petstore/python/client/PetApi.py @@ -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,' diff --git a/samples/client/petstore/python/client/swagger.py b/samples/client/petstore/python/client/swagger.py index 693c9fa629..d5e54666e0 100644 --- a/samples/client/petstore/python/client/swagger.py +++ b/samples/client/petstore/python/client/swagger.py @@ -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