We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bc9d207 commit 843346fCopy full SHA for 843346f
httpx/_content.py
@@ -208,9 +208,11 @@ def encode_request(
208
# Check if it's a list/tuple of bytes
209
for item in data:
210
if not isinstance(item, (bytes, bytearray, memoryview)):
211
+ item_type = type(item).__name__
212
raise TypeError(
- f"Expected bytes-like object in 'data' sequence, got {type(item).__name__}. "
213
- f"Use 'json=' for JSON data or 'data={{...}}' for form data."
+ f"Expected bytes-like object in 'data' sequence, "
214
+ f"got {item_type}. Use 'json=' for JSON data or "
215
+ f"'data={{...}}' for form data."
216
)
217
218
message = "Use 'content=<...>' to upload raw bytes/text content."
0 commit comments