Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support streaming HTTP body #35

Merged
merged 3 commits into from
Oct 12, 2022
Merged

support streaming HTTP body #35

merged 3 commits into from
Oct 12, 2022

Conversation

starius
Copy link
Owner

@starius starius commented Oct 11, 2022

Streaming. If you use use_as_body:"true", you can also set
is_stream:"true". In this case the field must be of type io.ReadCloser.
On the client side put any object implementing io.ReadCloser to such
a field in Request. It will be read and closed by the library and used
as HTTP request body. On the server side your handler
should read from the reader passed in that field of Request.
(You don't have to read the entire body and to close it.)
For Response, on the server side, the handler must put any object
implementing io.ReadCloser to such a field of Response.
The library will use it to generate HTTP response's body and close it.
On the client side your code must read from that reader the entire response
and then close it.

@starius starius force-pushed the streams branch 2 times, most recently from ebd9137 to 88c073a Compare October 11, 2022 20:55
@zmitry
Copy link
Contributor

zmitry commented Oct 12, 2022

looks good

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.

2 participants