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:
romanblack1
2021-09-25 00:05:38 -07:00
committed by GitHub
parent 00ea470e49
commit 7384a1e513
6 changed files with 24 additions and 18 deletions

View File

@@ -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'],