Skip to content

Commit

Permalink
Merge pull request #30 from p-fruck/actions/auto-update-1645805673
Browse files Browse the repository at this point in the history
API-Update: Update content type handling
  • Loading branch information
p-fruck authored Feb 25, 2022
2 parents c65c56f + 4a84867 commit 09d1520
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pfruck_contabo/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ def select_header_content_type(self, content_types, method=None, body=None):
:return: Content-Type (e.g. application/json).
"""
if not content_types:
return 'application/json'
return None

content_types = [x.lower() for x in content_types]

Expand Down Expand Up @@ -842,10 +842,11 @@ def call_with_http_info(self, **kwargs):
content_type_headers_list = self.headers_map['content_type']
if content_type_headers_list:
if params['body'] != "":
header_list = self.api_client.select_header_content_type(
content_types_list = self.api_client.select_header_content_type(
content_type_headers_list, self.settings['http_method'],
params['body'])
params['header']['Content-Type'] = header_list
if content_types_list:
params['header']['Content-Type'] = content_types_list

return self.api_client.call_api(
self.settings['endpoint_path'], self.settings['http_method'],
Expand Down

0 comments on commit 09d1520

Please sign in to comment.