diff --git a/src/apify_client/_http_client.py b/src/apify_client/_http_client.py index 131d32f3..2d76e4b5 100644 --- a/src/apify_client/_http_client.py +++ b/src/apify_client/_http_client.py @@ -101,14 +101,14 @@ def _prepare_request_call( data: Any = None, json: JSONSerializable | None = None, ) -> tuple[dict, dict | None, Any]: - if json and data: + if json is not None and data is not None: raise ValueError('Cannot pass both "json" and "data" parameters at the same time!') if not headers: headers = {} # dump JSON data to string, so they can be gzipped - if json: + if json is not None: data = jsonlib.dumps(json, ensure_ascii=False, allow_nan=False, default=str).encode('utf-8') headers['Content-Type'] = 'application/json'