sneako / finch

Elixir HTTP client, focused on performance
MIT License
1.27k stars 119 forks source link

Chunked body streaming with fine-grained control #288

Open whatyouhide opened 2 months ago

whatyouhide commented 2 months ago

Hiya @sneako šŸ‘‹ šŸ™ƒ

So I was playing around with some stuff yesterday and I ended up needing a way to take a Finch request and feed chunked body into it. This is doable with body: {:stream, stream}, but with that the control for when the body is fed into the request is in Finch's hands.

Instead, Iā€™m looking for an API like Mint's stream_request_body (which Finch's {:stream, stream} uses). Is this doable, or has it been proposed before? Haven't had time to look into feasibility of this yet. šŸ™ƒ

sneako commented 2 months ago

Hey Andrea! Sorry for the late reply, I was traveling for the second half of August. I'm back at it now.

This isn't a use case I have needed or thought much about yet, but its not something I would be against.

Maybe some pseudo code showing your ideal API could help us flesh it out a bit?