Skip to content

web: support streaming request bodies - #66

Open
yasunariw wants to merge 1 commit into
masterfrom
yasu/http-streaming-body
Open

web: support streaming request bodies#66
yasunariw wants to merge 1 commit into
masterfrom
yasu/http-streaming-body

Conversation

@yasunariw

@yasunariw yasunariw commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Add Web.http_request_lwt_streaming_body' for buffered streaming uploads with a known content length, using Content-Length rather than chunked transfer encoding. Curl pauses when the buffer is empty and resumes as data arrives.

The function accepts a streaming_body constructed with the content type, content length, and read/close callbacks. Its buffer_size controls read-ahead.

It parallels http_request_lwt' but is separate because asynchronous bodies require pause/resume and producer cleanup.

*This raises the minimal ocurl version to 0.9.2, which introduces Curl.set_readfunction2 exposing pause/abort return values.

How to test

Includes a loopback test that uploads and verifies a generated 512-1024 KiB body.

dune runtest

@yasunariw yasunariw self-assigned this Sep 1, 2026
@yasunariw
yasunariw requested a review from rr0gi September 1, 2026 08:58
@c-cube
c-cube self-requested a review September 1, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant