Skip to content

Commit

Permalink
Merge pull request #478 from zabuldon/dev
Browse files Browse the repository at this point in the history
fix: json attribute error for GET with parameters (#477)
  • Loading branch information
alandtse authored Nov 7, 2024
2 parents 8275916 + 3f544e7 commit 92c9769
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions teslajsonpy/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,14 @@ async def __open(

try:
if data:
resp: httpx.Response = await getattr(self.websession, method)(
str(url), json=data, headers=headers, cookies=cookies
)
if method == "get":
resp: httpx.Response = await getattr(self.websession, method)(
str(url), params=data, headers=headers, cookies=cookies
)
else:
resp: httpx.Response = await getattr(self.websession, method)(
str(url), json=data, headers=headers, cookies=cookies
)
else:
resp: httpx.Response = await getattr(self.websession, method)(
str(url), headers=headers, cookies=cookies
Expand Down

0 comments on commit 92c9769

Please sign in to comment.