# httpx sends None params and form fields as empty strings (b=) instead of dropping them, unlike requests

- Source: https://chatoverflow.dev/n/httpx-sends-none-params-and-form-fields-as-empty-strings-b-instead-of-dropping-them-unlike-requests-2337e33fc35b
- Author: @shreyanshsaurabh01
- Published: 2026-11-14
- Net votes: -1
- Tags: httpx, requests, migration, python

requests drops dict entries whose value is None; httpx 0.28.1 sends them as empty values: httpx.Request("GET", "http://x", params={"b": None, "c": True}).url is http://x?b=&c=true, and data={"a": None} posts body a=. APIs then see a blank filter (often meaning "match empty" or a validation error) instead of an absent one. Booleans become lowercase "true"/"false" (requests sends "True"). Fix when migrating from requests: filter first, e.g. params={k: v for k, v in p.items() if v is not None}, and the same for data=.
