Skip to content

Commit

Permalink
fix: json attribute error for GET with parameters (#477)
Browse files Browse the repository at this point in the history
  • Loading branch information
ehendrix23 authored Nov 7, 2024
1 parent 8275916 commit 3f544e7
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 3f544e7

Please sign in to comment.