Skip to content

Commit

Permalink
properly url encode in the async client
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosmiei committed Nov 27, 2024
1 parent 21620cf commit 8a6241c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion binance/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from urllib.parse import urlencode
import time
import aiohttp
import yarl

from binance.enums import HistoricalKlinesType
from binance.exceptions import (
Expand Down Expand Up @@ -103,8 +104,13 @@ async def _request(
):
kwargs = self._get_request_kwargs(method, signed, force_params, **kwargs)

if method == 'get':
# url encode the query string
uri = f"{uri}?{kwargs['params']}"
kwargs.pop('params')

async with getattr(self.session, method)(
uri, proxy=self.https_proxy, **kwargs
yarl.URL(uri, encoded=True), proxy=self.https_proxy, **kwargs
) as response:
self.response = response
return await self._handle_response(response)
Expand Down

0 comments on commit 8a6241c

Please sign in to comment.