aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/guide
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-12-31 17:08:59 +0100
committerLoïc Hoguin <[email protected]>2018-12-31 17:08:59 +0100
commit630bd475e6aa4b9fdde01272236d08305034cb48 (patch)
tree096c732caef432e2dd56fbd4d50a2d949428f5c0 /doc/src/guide
parent32779615616fe3ae052eef94d838ecc9180045a7 (diff)
downloadgun-630bd475e6aa4b9fdde01272236d08305034cb48.tar.gz
gun-630bd475e6aa4b9fdde01272236d08305034cb48.tar.bz2
gun-630bd475e6aa4b9fdde01272236d08305034cb48.zip
Separate request/4,5,6 into headers/4,5 and request/5,6
This cleaner separation gets rid of the implicit body check that was causing issues for many users. Now the body is either given explicitly or it is expected via future gun:data/3 calls.
Diffstat (limited to 'doc/src/guide')
-rw-r--r--doc/src/guide/http.asciidoc12
1 files changed, 4 insertions, 8 deletions
diff --git a/doc/src/guide/http.asciidoc b/doc/src/guide/http.asciidoc
index 652030a..fb0c7dc 100644
--- a/doc/src/guide/http.asciidoc
+++ b/doc/src/guide/http.asciidoc
@@ -108,7 +108,7 @@ desirable. The request body of a PATCH method may be a partial
representation or a list of instructions on how to update the
resource.
-The `gun:post/4,5`, `gun:put/4,5` and `gun:patch/4,5` functions
+The functions `gun:post/4,5`, `gun:put/4,5` and `gun:patch/4,5`
take a body as their fourth argument. These functions do
not require any body-specific header to be set, although
it is always recommended to set the content-type header.
@@ -127,13 +127,9 @@ StreamRef = gun:post(ConnPid, "/organizations/ninenines", [
], Body).
----
-The `gun:post/3`, `gun:put/3` and `gun:patch/3` functions
-do not take a body in their arguments. If a body is to be
-provided later on, using the `gun:data/4` function, then
-the request headers must indicate this. This can be done
-by setting the content-length or content-type request
-headers. If these headers are not set then Gun will assume
-the request has no body.
+The functions `gun:post/3,4`, `gun:put/3,4` and `gun:patch/3,4`
+do not take a body in their arguments: the body must be
+provided later on using the `gun:data/4` function.
It is recommended to send the content-length header if you
know it in advance, although this is not required. If it