From d91fc275f61939f1bd5e5c7a04c3c1ac62a7437e Mon Sep 17 00:00:00 2001 From: k1000dai Date: Mon, 25 Nov 2024 15:03:39 +0100 Subject: [PATCH] use params --- semanticscholar/ApiRequester.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/semanticscholar/ApiRequester.py b/semanticscholar/ApiRequester.py index 6b3d3a7..449de61 100644 --- a/semanticscholar/ApiRequester.py +++ b/semanticscholar/ApiRequester.py @@ -105,7 +105,7 @@ async def _get_data_async( payload: dict = None ) -> Union[dict, List[dict]]: - url = f'{url}?{parameters.lstrip("&")}' + parameters=parameters.lstrip("&") method = 'POST' if payload else 'GET' logger.debug(f'HTTP Request: {method} {url}') @@ -115,7 +115,7 @@ async def _get_data_async( async with httpx.AsyncClient() as client: r = await client.request( - method, url, timeout=self._timeout, headers=headers, + method, url, params=parameters,timeout=self._timeout, headers=headers, json=payload) data = {}