From 129f327bc69b0127b783a7517b9558b3461b4711 Mon Sep 17 00:00:00 2001 From: KShivendu Date: Tue, 5 Sep 2023 16:54:00 +0530 Subject: [PATCH] fix: Types in async client api requests --- supertokens_python/querier.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/supertokens_python/querier.py b/supertokens_python/querier.py index f2bb4e331..60b701a4b 100644 --- a/supertokens_python/querier.py +++ b/supertokens_python/querier.py @@ -77,26 +77,25 @@ async def api_request( self, url: str, method: str, # ["POST", "GET"] - headers: Optional[Dict[str, Any]] = None, - params: Optional[Dict[str, Any]] = None, - json: Optional[Dict[str, Any]] = None, + *args: Any, + **kwargs: Any, ) -> Response: try: async with AsyncClient() as client: if method == "GET": - return await client.get(url, headers=headers, params=params, json=json) # type: ignore + return await client.get(url, *args, **kwargs) # type: ignore if method == "POST": - return await client.post(url, headers=headers, params=params, json=json) # type: ignore + return await client.post(url, *args, **kwargs) # type: ignore if method == "PUT": - return await client.put(url, headers=headers, params=params, json=json) # type: ignore + return await client.put(url, *args, **kwargs) # type: ignore if method == "DELETE": - return await client.delete(url, headers=headers, params=params, json=json) # type: ignore + return await client.delete(url, *args, **kwargs) # type: ignore raise Exception("Shouldn't come here") except AsyncLibraryNotFoundError: # Try one more time loop = create_or_get_event_loop() return loop.run_until_complete( - self.api_request(url, method, headers, params, json) + self.api_request(url, method, *args, **kwargs) ) async def get_api_version(self):