Skip to content

Commit

Permalink
Fix: Post request were done without Content-Type headers (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
NevilleDubuis authored Dec 5, 2024
1 parent 5b6eefd commit 3351993
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion certbot_dns_infomaniak/dns_infomaniak.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,10 @@ def _post_request(self, url, payload):
:param dict payload : body of request
"""
url = self.baseUrl + url
headers = {"Content-Type": "application/json"}
json_data = json.dumps(payload)
logger.debug("POST %s", url)
with self.session.post(url, data=payload) as req:
with self.session.post(url, data=json_data, headers=headers) as req:
try:
result = req.json()
except json.decoder.JSONDecodeError as exc:
Expand Down

0 comments on commit 3351993

Please sign in to comment.