diff options
author | Loïc Hoguin <[email protected]> | 2017-05-23 20:47:46 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2017-05-23 20:47:46 +0200 |
commit | 41c769ab5c19da92ecba35d9accc4bc123029e8d (patch) | |
tree | 67bb7f4d3c9200deb38863666bd41e07ca448aea /docs/en/gun/1.0/guide/http.asciidoc | |
parent | fe7e6a41a50b5f191b98c1bcdc99d8297f099673 (diff) | |
download | ninenines.eu-41c769ab5c19da92ecba35d9accc4bc123029e8d.tar.gz ninenines.eu-41c769ab5c19da92ecba35d9accc4bc123029e8d.tar.bz2 ninenines.eu-41c769ab5c19da92ecba35d9accc4bc123029e8d.zip |
Remove the use of bootstrap-carousel
The custom.js file was converted to not use jquery also. Once
bootstrap is gone, we can remove jquery entirely.
Diffstat (limited to 'docs/en/gun/1.0/guide/http.asciidoc')
-rw-r--r-- | docs/en/gun/1.0/guide/http.asciidoc | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/docs/en/gun/1.0/guide/http.asciidoc b/docs/en/gun/1.0/guide/http.asciidoc index 465a4c53..e856fb18 100644 --- a/docs/en/gun/1.0/guide/http.asciidoc +++ b/docs/en/gun/1.0/guide/http.asciidoc @@ -45,7 +45,7 @@ handling of responses will be explained further on. ==== GET and HEAD -Use `gun:get/{2,3}` to request a resource. +Use `gun:get/{2,3,4}` to request a resource. .GET "/organizations/ninenines" @@ -64,7 +64,7 @@ Note that the list of headers has the field name as a binary. The field value is iodata, which is either a binary or an iolist. -Use `gun:head/{2,3}` if you don't need the response body. +Use `gun:head/{2,3,4}` if you don't need the response body. .HEAD "/organizations/ninenines" @@ -101,7 +101,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`, `gun:put/4` and `gun:patch/4` functions +The `gun:post/{4,5}`, `gun:put/{4,5}` and `gun:patch/{4,5}` functions 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. @@ -171,7 +171,7 @@ do_sendfile(ConnPid, StreamRef, IoDevice) -> ==== DELETE -Use `gun:delete/{2,3}` to delete a resource. +Use `gun:delete/{2,3,4}` to delete a resource. .DELETE "/organizations/ninenines" @@ -211,7 +211,7 @@ StreamRef = gun:options(ConnPid, "*"). ==== Requests with an arbitrary method -The `gun:request/{4,5}` function can be used to send requests +The `gun:request/{4,5,6}` function can be used to send requests with a configurable method name. It is mostly useful when you need a method that Gun does not understand natively. @@ -360,3 +360,14 @@ gun:flush(ConnPid). [source,erlang] gun:flush(StreamRef). + +=== Redirecting responses to a different process + +Gun allows you to specify which process will handle responses +to a request via the `reply_to` request option. + +.GET "/organizations/ninenines" to a different process + +[source,erlang] +StreamRef = gun:get(ConnPid, "/organizations/ninenines", [], + #{reply_to => Pid}). |