httpx
httpx copied to clipboard
Updated _content.py: encode_content to accept a bytearray non-streamed content
Summary
Updated _content.py: encode_content to accept a bytearray as well as bytes/str as a static content type. This allows sending a mutable bytearray without having to cast to an immutable bytes object, trigging a memory copy before sending.
Checklist
- [x] I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
- [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
- [x] I've updated the documentation accordingly.