diff --git a/src/sfapi_client/_async/client.py b/src/sfapi_client/_async/client.py index 8bf1b53..50d6ce1 100644 --- a/src/sfapi_client/_async/client.py +++ b/src/sfapi_client/_async/client.py @@ -382,12 +382,15 @@ async def get(self, url: str, params: Dict[str, Any] = {}) -> httpx.Response: wait=tenacity.wait_exponential(max=MAX_RETRY), stop=tenacity.stop_after_attempt(MAX_RETRY), ) - async def post(self, url: str, data: Dict[str, Any]) -> httpx.Response: + async def post( + self, url: str, data: Dict[str, Any] = None, json: Dict[str, Any] = None + ) -> httpx.Response: client = await self._http_client() r = await client.post( f"{self._api_base_url}/{url}", data=data, + json=json, ) r.raise_for_status() diff --git a/src/sfapi_client/_sync/client.py b/src/sfapi_client/_sync/client.py index 8aa8aaa..823ec1e 100644 --- a/src/sfapi_client/_sync/client.py +++ b/src/sfapi_client/_sync/client.py @@ -382,12 +382,18 @@ def get(self, url: str, params: Dict[str, Any] = {}) -> httpx.Response: wait=tenacity.wait_exponential(max=MAX_RETRY), stop=tenacity.stop_after_attempt(MAX_RETRY), ) - def post(self, url: str, data: Dict[str, Any]) -> httpx.Response: + def post( + self, + url: str, + data: Dict[str, Any] = None, + json: Dict[str, Any] = None + ) -> httpx.Response: client = self._http_client() r = client.post( f"{self._api_base_url}/{url}", data=data, + json=json, ) r.raise_for_status()