mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-16 05:00:24 +00:00
![]() Adds a new type of streaming response fun. It can be set in a similar way to a streaming body fun with known length: Req2 = cowboy_req:set_resp_body_fun(chunked, StreamFun, Req) The fun, StreamFun, should accept a fun as its single argument. This fun, ChunkFun, is used to send chunks of iodata: ok = ChunkFun(IoData) ChunkFun should not be called with an empty binary or iolist as this will cause HTTP 1.1 clients to believe the stream is over. The final (0 length) chunk will be sent automatically - even if it has already been sent - assuming no exception is raised. Also note that the connection will close after the last chunk for HTTP 1.0 clients. |
||
---|---|---|
.. | ||
autobahn_SUITE_data | ||
http_SUITE_data | ||
ws_SUITE_data | ||
autobahn_SUITE.erl | ||
cover.spec | ||
eunit_SUITE.erl | ||
http_SUITE.erl | ||
rest_postonly_resource.erl | ||
ws_SUITE.erl |