Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/apify_client/_http_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down