You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from httpx.content_streams import encode
stream = encode(data={}, files={}, boundary=b"+++")
print(b"".join([part for part in stream]))
# b'--+++--\r\n'
I see two ways to solve it:
Check files not only for None but also for emptiness in _content_streams.decode
Check the count of fields in MultipartStream.__init__ and doesn't write anything if fields are empty.
I already opened PR (#861) with a test example. If someone tells me which of these options is better, I will be happy to implement it 🙌
Activity