drogue-iot / reqwless

Rust async HTTP client for embedded/no_std
Apache License 2.0
129 stars 18 forks source link

Let response only read headers and defer reading body #9

Closed rmja closed 1 year ago

rmja commented 1 year ago

This PR changes the current behavior of the Response type. Previously the body was consumed when reading the response. This is now split in two so that only the headers are read to create the Response type. The user can then later read the response body.

TODO: How to handle if the user does not actually read the body? We should probably drain the connection in this case on Drop or something similar.