These two scripts should be allowed to bring us in line with Requests: ```python def sync_gen(): yield b"data" async def async_gen(): yield b"data" # ahip supports async and sync iterators import ahip import trio http = ahip.PoolManager() async def main(): await http.request("POST", "http://example.com", body=sync_gen()) await http.request("POST", "http://example.com", body=async_gen()) trio.run(main) # 'hip' supports only sync import hip http = hip.PoolManager() http.request("POST", "http://example.com", body=sync_gen()) ``` Some notes: - Treat both of these cases as errors if a redirect occurs, raise `UnrewindableBody` exception - shouldn't set `content-length` since length is not known until we drain the body, should be `transfer-encoding: chunked` Related: - https://github.com/python-trio/hip/issues/199 - https://github.com/python-trio/hip/issues/135
These two scripts should be allowed to bring us in line with Requests:
Some notes:
UnrewindableBodyexceptioncontent-lengthsince length is not known until we drain the body, should betransfer-encoding: chunkedRelated: