Skip to content

Commit

Permalink
Merge pull request #4 from Neeeflix/patch-1
Browse files Browse the repository at this point in the history
Improve post to get suitable results
  • Loading branch information
JonasJoKuJonas authored Dec 3, 2024
2 parents 3124ff2 + 396a04f commit 84431f8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
13 changes: 10 additions & 3 deletions custom_components/trias/trias_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,17 @@ def get(self, payload):
xml = header.replace("PAYLOAD__", payload)
xml = xml.replace("NOW__", convert_to_zulu_format())

req = requests.post(
headers = {
"Content-Type": "text/xml",
"User-Agent": "Wget/1.21.1 (linux-gnu)",
}

req = requests.request(
"post",
self.url,
data=xml,
headers={"Content-Type": "application/xml"},
data=xml.encode("utf-8"),
headers=headers,
timeout=10,
)

req.encoding = "utf-8"
Expand Down
1 change: 0 additions & 1 deletion custom_components/trias/trias_client/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class ApiError(Exception):
class InvalidLocationName(Exception):
pass


class HttpError(Exception):
def __init__(self, status_code, response, *args: object) -> None:
super().__init__(*args)
Expand Down

0 comments on commit 84431f8

Please sign in to comment.