Skip to content

fix(network): keep blank values in Request.post_data_json for form bodies - #3248

Merged
Yury Semikhatsky (yury-s) merged 1 commit into
microsoft:mainfrom
MohammedAlkindi:fix/network-keep-blank-values-in-post-data-json
Oct 13, 2026
Merged

Yury Semikhatsky (yury-s) merged 1 commit into
microsoft:mainfrom
MohammedAlkindi:fix/network-keep-blank-values-in-post-data-json

Conversation

@MohammedAlkindi

Copy link
Copy Markdown
Contributor
  • Request.post_data_json parsed form bodies with parse_qsl, which drops blank values, so a=&b=1 came back as {'b': '1'}. It now passes keep_blank_values=True, matching the JS client's URLSearchParams.
  • The existing form-urlencoded test now sends an empty field.

Fixes microsoft/playwright#43330

…dies

parse_qsl drops empty fields by default, so a body such as a=&b=1 lost the a key. The JS client uses URLSearchParams, which keeps them.
@yury-s
Yury Semikhatsky (yury-s) merged commit 5313ac2 into microsoft:main Oct 13, 2026
28 of 29 checks passed
@MohammedAlkindi
Mohammed Alkindi (MohammedAlkindi) deleted the fix/network-keep-blank-values-in-post-data-json branch October 15, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Python Request.post_data_json drops form fields with empty values

3 participants