Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion playwright/_impl/_fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ async def _inner_fetch(
post_data_buffer = data.encode()
elif isinstance(data, bytes):
post_data_buffer = data
elif isinstance(data, (dict, list, int, bool)):
elif isinstance(data, (dict, list, int, float, bool)):
json_data = json.dumps(data)
else:
raise Error(f"Unsupported 'data' type: {type(data)}")
Expand Down
1 change: 1 addition & 0 deletions tests/async/test_fetch_global.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ async def test_should_serialize_request_data(
([], "[]"),
({}, "{}"),
("", ""),
(1.5, "1.5"),
]:
response = await request.post(server.PREFIX + "/echo", data=data)
assert response.status == 200
Expand Down