diff options
author | Loïc Hoguin <[email protected]> | 2016-08-10 14:33:43 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2016-08-10 14:33:43 +0200 |
commit | ae95e87eb1c352b96b43a431fd4693d7d80a4b64 (patch) | |
tree | efd4eead29a4a6ea9d9ab2952decfda5c10f4ffb /examples/chunked_hello_world/src | |
parent | 00f3ae7d20fab7e1fb5707ac2f35cf1d003f9d39 (diff) | |
download | cowboy-ae95e87eb1c352b96b43a431fd4693d7d80a4b64.tar.gz cowboy-ae95e87eb1c352b96b43a431fd4693d7d80a4b64.tar.bz2 cowboy-ae95e87eb1c352b96b43a431fd4693d7d80a4b64.zip |
Update examples to the new interface
Diffstat (limited to 'examples/chunked_hello_world/src')
-rw-r--r-- | examples/chunked_hello_world/src/toppage_handler.erl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/chunked_hello_world/src/toppage_handler.erl b/examples/chunked_hello_world/src/toppage_handler.erl index 22e52b9..d492d95 100644 --- a/examples/chunked_hello_world/src/toppage_handler.erl +++ b/examples/chunked_hello_world/src/toppage_handler.erl @@ -6,10 +6,10 @@ -export([init/2]). init(Req, Opts) -> - cowboy_req:chunked_reply(200, Req), - cowboy_req:chunk("Hello\r\n", Req), + cowboy_req:stream_reply(200, Req), + cowboy_req:stream_body("Hello\r\n", nofin, Req), timer:sleep(1000), - cowboy_req:chunk("World\r\n", Req), + cowboy_req:stream_body("World\r\n", nofin, Req), timer:sleep(1000), - cowboy_req:chunk("Chunked!\r\n", Req), + cowboy_req:stream_body("Chunked!\r\n", fin, Req), {ok, Req, Opts}. |