forked from loafle/openapi-generator-original
Define content type only if the body is not empty (#9766)
* define content type iff the body is not empty * update samples
This commit is contained in:
@@ -826,9 +826,10 @@ class Endpoint(object):
|
||||
|
||||
content_type_headers_list = self.headers_map['content_type']
|
||||
if content_type_headers_list:
|
||||
header_list = self.api_client.select_header_content_type(
|
||||
content_type_headers_list)
|
||||
params['header']['Content-Type'] = header_list
|
||||
if params['body'] != "":
|
||||
header_list = self.api_client.select_header_content_type(
|
||||
content_type_headers_list)
|
||||
params['header']['Content-Type'] = header_list
|
||||
|
||||
return self.api_client.call_api(
|
||||
self.settings['endpoint_path'], self.settings['http_method'],
|
||||
|
||||
Reference in New Issue
Block a user