aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/manual/gun.request.asciidoc
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/manual/gun.request.asciidoc
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/manual/gun.request.asciidoc')
-rw-r--r--doc/src/manual/gun.request.asciidoc16
1 files changed, 4 insertions, 12 deletions
diff --git a/doc/src/manual/gun.request.asciidoc b/doc/src/manual/gun.request.asciidoc
index ec169ac..f5c1cd8 100644
--- a/doc/src/manual/gun.request.asciidoc
+++ b/doc/src/manual/gun.request.asciidoc
@@ -8,9 +8,6 @@ gun:request - Perform the given request
[source,erlang]
----
-request(ConnPid, Method, Path, Headers)
- -> StreamRef
-
request(ConnPid, Method, Path, Headers, Body)
-> request(ConnPid, Method, Path, Headers, Body, #{})
@@ -31,15 +28,6 @@ Perform the given request.
This is a general purpose function that should only be
used when other method-specific functions do not apply.
-The behavior of this function varies depending on whether
-a body is provided.
-
-The function `request/4` expects either a content-length
-or content-type header to indicate that a body will be
-sent afterwards. Gun will assume the request has no body
-otherwise. The body can then be sent using
-link:man:gun:data(3)[gun:data(3)].
-
The function `request/5,6` sends the entire request, including
the request body, immediately. It is therefore not possible
to use link:man:gun:data(3)[gun:data(3)] after that. You
@@ -81,6 +69,9 @@ to this new stream.
== Changelog
+* *2.0*: Implicit body detection has been removed. The body
+ must now be provided either directly (even if empty)
+ or using link:man:gun:headers(3)[gun:headers(3)].
* *1.0*: Function introduced.
== Examples
@@ -97,6 +88,7 @@ StreamRef = gun:request(ConnPid, <<"PUT">>,
== See also
link:man:gun(3)[gun(3)],
+link:man:gun:headers(3)[gun:headers(3)],
link:man:gun:await(3)[gun:await(3)],
link:man:gun:await_body(3)[gun:await_body(3)],
link:man:gun_push(3)[gun_push(3)],