gleam-lang / httpc

📡 Make requests to HTTP servers with httpc
https://hexdocs.pm/gleam_httpc/
Apache License 2.0
85 stars 14 forks source link

Expose streaming API #31

Open lpil opened 4 months ago

lpil commented 4 months ago

For example, for @hayleigh-dot-dev's chat-bot project

RobertCraigie commented 1 month ago

hey I'm also interested in a response body streaming API, did you have a particular design in mind?

Maybe something like this?

pub fn send_stream(req: Request(String)) -> Result(Response(Iterator(BitArray)), Dynamic)
lpil commented 4 weeks ago

I think it would be message based. Iterators are not suitable for streaming like this.

RobertCraigie commented 3 weeks ago

ah I see thanks, would you be able to share an example snippet? I'm new to Gleam so I'm not sure what that would look like exactly

lpil commented 3 weeks ago

I don't believe anyone has done any research and design on this yet.