Skip to content

Commit

Permalink
Correct usage is .content for bytes, not .data()
Browse files Browse the repository at this point in the history
  • Loading branch information
sjportalatin committed Aug 27, 2024
1 parent 84cff3f commit 6efb84b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions livekit-api/livekit/api/twirp_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ def sync_request(

serialized_data = data.SerializeToString()
resp = requests.post(url, headers=headers, data=serialized_data)
if resp.status == 200:
return response_class.FromString(resp.data())
if resp.status_code == 200:
return response_class.FromString(resp.content)
else:
# when we have an error, Twirp always encode it in json
error_data = resp.json()
Expand Down

0 comments on commit 6efb84b

Please sign in to comment.