diff --git a/src/freebox_api/access.py b/src/freebox_api/access.py index e23fad45..f75c4363 100644 --- a/src/freebox_api/access.py +++ b/src/freebox_api/access.py @@ -138,12 +138,15 @@ async def get( return await self._perform_request(self.session.get, end_url) async def post( - self, end_url: str, payload: Optional[Dict[str, Any]] = None + self, end_url: str, payload: Optional[Dict[str, Any]] = None, json_transform: bool = True ) -> Dict[str, Any]: """ Send post request and return results """ - data = json.dumps(payload) if payload else None + if json_transform: + data = json.dumps(payload) if payload else None + else: + data = payload if payload else None return await self._perform_request(self.session.post, end_url, data=data) # type: ignore async def put( diff --git a/src/freebox_api/api/download.py b/src/freebox_api/api/download.py index 5609551c..682add4f 100644 --- a/src/freebox_api/api/download.py +++ b/src/freebox_api/api/download.py @@ -108,9 +108,9 @@ async def add_download_task_from_url( """ Add download from url - download_url : `str` + download_url : `dict` """ - return await self._access.post("downloads/add/", download_url) + return await self._access.post("downloads/add/", download_url, False) async def add_download_task_from_file( self, download_file: Dict[str, Any]