aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/manual/cowboy_req.read_body.asciidoc
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2024-01-08 15:13:18 +0100
committerLoïc Hoguin <[email protected]>2024-01-08 15:13:18 +0100
commite4a78aaeb110a3eda5269b618230b8bcb18fbcc2 (patch)
tree9c85e90adbe50b118ba0846473b17929bbda5e7d /doc/src/manual/cowboy_req.read_body.asciidoc
parentc1490d7d5503636e7995583222cf8edf5f882db5 (diff)
downloadcowboy-e4a78aaeb110a3eda5269b618230b8bcb18fbcc2.tar.gz
cowboy-e4a78aaeb110a3eda5269b618230b8bcb18fbcc2.tar.bz2
cowboy-e4a78aaeb110a3eda5269b618230b8bcb18fbcc2.zip
Document body reading in auto mode
It is now tested both via cowboy_req:read_body and via cowboy_req:cast. Removes a bad example from the guide of body reading with period of infinity, which does not work.
Diffstat (limited to 'doc/src/manual/cowboy_req.read_body.asciidoc')
-rw-r--r--doc/src/manual/cowboy_req.read_body.asciidoc10
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/src/manual/cowboy_req.read_body.asciidoc b/doc/src/manual/cowboy_req.read_body.asciidoc
index 2b87405..7da76ef 100644
--- a/doc/src/manual/cowboy_req.read_body.asciidoc
+++ b/doc/src/manual/cowboy_req.read_body.asciidoc
@@ -68,6 +68,13 @@ The `timeout` option is a safeguard in case the connection
process becomes unresponsive. The function will crash if no
message was received in that interval. The timeout should be
larger than the period. It defaults to the period + 1 second.
++
+Auto mode can be enabled by setting the `length` to `auto` and
+the `period` to `infinity`. When auto mode is used, Cowboy will
+send data to the handler as soon as it receives it, regardless
+of its size. It will wait indefinitely until data is available.
+Auto mode's main purpose is asynchronous body reading using
+link:man:cowboy_req:cast(3)[cowboy_req:cast(3)].
== Return value
@@ -86,6 +93,9 @@ body has been read.
== Changelog
+* *2.11*: The `length` option now accepts `auto` and the
+ period now accepts `infinity`. This adds support for
+ reading the body in auto mode.
* *2.0*: Function introduced. Replaces `body/1,2`.
== Examples