From 92b54aacc0de5446dd5497c39897b0bbff72e626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 13 Jun 2018 09:54:12 +0200 Subject: Rebuild using Asciideck --- .../manual/cowboy_req.stream_trailers/index.html | 118 ++++++--------------- 1 file changed, 33 insertions(+), 85 deletions(-) (limited to 'docs/en/cowboy/2.3/manual/cowboy_req.stream_trailers/index.html') diff --git a/docs/en/cowboy/2.3/manual/cowboy_req.stream_trailers/index.html b/docs/en/cowboy/2.3/manual/cowboy_req.stream_trailers/index.html index c65aa4ef..f1840c58 100644 --- a/docs/en/cowboy/2.3/manual/cowboy_req.stream_trailers/index.html +++ b/docs/en/cowboy/2.3/manual/cowboy_req.stream_trailers/index.html @@ -62,107 +62,55 @@

cowboy_req:stream_trailers(3)

-

Name

-
-

cowboy_req:stream_trailers - Send the response trailers

-
-
-
+

cowboy_req:stream_trailers - Send the response trailers

Description

-
-
-
-
stream_trailers(Trailers, Req :: cowboy_req:req()) -> ok
-
-Trailers :: cowboy:http_headers()
-

Send the response trailers and terminate the stream.

-

This function can only be called once, after initiating -a response using -cowboy_req:stream_reply(3) -and sending zero or more body chunks using -cowboy_req:stream_body(3) -with the nofin argument set. The function stream_trailers/2 -implies fin and automatically terminate the response.

-

You must list all field names sent in trailers in the -trailer header, otherwise they might be dropped by intermediaries -or clients.

-
-
-
+
stream_trailers(Trailers, Req :: cowboy_req:req()) -> ok
+
+Trailers :: cowboy:http_headers()
+
+

Send the response trailers and terminate the stream.

+

This function can only be called once, after initiating a response using cowboy_req:stream_reply(3) and sending zero or more body chunks using cowboy_req:stream_body(3) with the nofin argument set. The function stream_trailers/2 implies fin and automatically terminate the response.

+

You must list all field names sent in trailers in the trailer header, otherwise they might be dropped by intermediaries or clients.

Arguments

-
-
-
-Trailers -
-
-

-Trailer field values to be sent. -

+
Trailers
+

Trailer field values to be sent.

-
-Req -
-
-

-The Req object. -

+
Req
+

The Req object.

-
-
- -
+

Return value

-
-

The atom ok is always returned. It can be safely ignored.

-
-
-
+

The atom ok is always returned. It can be safely ignored.

Changelog

-
-
    -
  • -

    -2.2: Function introduced. -

    +
    • 2.2: Function introduced.
    • -
-
-
-
+

Examples

-
-
-
Stream a response body with trailers
-
-
Req = cowboy_req:stream_reply(200, #{
-    <<"content-type">> => <<"text/plain">>,
-    <<"trailer">> => <<"expires, content-md5">>
-}, Req0),
-cowboy_req:stream_body(<<"Hello\n">>, nofin, Req),
-timer:sleep(1000),
-cowboy_req:stream_body(<<"World!\n">>, nofin, Req).
-cowboy_req:stream_trailers(#{
-    <<"expires">> => <<"Sun, 10 Dec 2017 19:13:47 GMT">>,
-    <<"content-md5">> => <<"fbf68a8e34b2ded53bba54e68794b4fe">>
-}, Req).
-
-
-
+
Req = cowboy_req:stream_reply(200, #{
+    <<"content-type">> => <<"text/plain">>,
+    <<"trailer">> => <<"expires, content-md5">>
+}, Req0),
+cowboy_req:stream_body(<<"Hello\n">>, nofin, Req),
+timer:sleep(1000),
+cowboy_req:stream_body(<<"World!\n">>, nofin, Req).
+cowboy_req:stream_trailers(#{
+    <<"expires">> => <<"Sun, 10 Dec 2017 19:13:47 GMT">>,
+    <<"content-md5">> => <<"fbf68a8e34b2ded53bba54e68794b4fe">>
+}, Req).
+

See also

-
- -
- +

cowboy_req(3), cowboy_req:stream_reply(3), cowboy_req:stream_body(3)

+ -- cgit v1.2.3