()
| 228 | elif hasattr(body, "read"): |
| 229 | |
| 230 | def chunk_readable() -> typing.Iterable[bytes]: |
| 231 | encode = isinstance(body, io.TextIOBase) |
| 232 | while True: |
| 233 | datablock = body.read(blocksize) |
| 234 | if not datablock: |
| 235 | break |
| 236 | if encode: |
| 237 | datablock = datablock.encode("utf-8") |
| 238 | yield datablock |
| 239 | |
| 240 | chunks = chunk_readable() |
| 241 | content_length = None |