diff options
Diffstat (limited to 'doc/src/guide/http.asciidoc')
-rw-r--r-- | doc/src/guide/http.asciidoc | 12 |
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 |