summaryrefslogtreecommitdiffstats
path: root/docs/en/gun/1.0/guide
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-05-23 20:47:46 +0200
committerLoïc Hoguin <[email protected]>2017-05-23 20:47:46 +0200
commit41c769ab5c19da92ecba35d9accc4bc123029e8d (patch)
tree67bb7f4d3c9200deb38863666bd41e07ca448aea /docs/en/gun/1.0/guide
parentfe7e6a41a50b5f191b98c1bcdc99d8297f099673 (diff)
downloadninenines.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')
-rw-r--r--docs/en/gun/1.0/guide/connect/index.html1
-rw-r--r--docs/en/gun/1.0/guide/http.asciidoc21
-rw-r--r--docs/en/gun/1.0/guide/http/index.html26
-rw-r--r--docs/en/gun/1.0/guide/index.html1
-rw-r--r--docs/en/gun/1.0/guide/introduction/index.html1
-rw-r--r--docs/en/gun/1.0/guide/protocols.asciidoc2
-rw-r--r--docs/en/gun/1.0/guide/protocols/index.html3
-rw-r--r--docs/en/gun/1.0/guide/start/index.html1
-rw-r--r--docs/en/gun/1.0/guide/websocket.asciidoc4
-rw-r--r--docs/en/gun/1.0/guide/websocket/index.html4
10 files changed, 45 insertions, 19 deletions
diff --git a/docs/en/gun/1.0/guide/connect/index.html b/docs/en/gun/1.0/guide/connect/index.html
index 4ace37e6..ed3b4970 100644
--- a/docs/en/gun/1.0/guide/connect/index.html
+++ b/docs/en/gun/1.0/guide/connect/index.html
@@ -314,7 +314,6 @@ when the connection has been closed.</p></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
- <script src="/js/bootstrap-carousel.js"></script>
<script src="/js/bootstrap-dropdown.js"></script>
<script src="/js/custom.js"></script>
</body>
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}).
diff --git a/docs/en/gun/1.0/guide/http/index.html b/docs/en/gun/1.0/guide/http/index.html
index 9b345ae1..2f3aadb3 100644
--- a/docs/en/gun/1.0/guide/http/index.html
+++ b/docs/en/gun/1.0/guide/http/index.html
@@ -112,7 +112,7 @@ header if it has not been provided in the request arguments.</p></div>
handling of responses will be explained further on.</p></div>
<div class="sect3">
<h4 id="_get_and_head">GET and HEAD</h4>
-<div class="paragraph"><p>Use <code>gun:get/{2,3}</code> to request a resource.</p></div>
+<div class="paragraph"><p>Use <code>gun:get/{2,3,4}</code> to request a resource.</p></div>
<div class="listingblock">
<div class="title">GET "/organizations/ninenines"</div>
<div class="content"><!-- Generator: GNU source-highlight 3.1.8
@@ -133,7 +133,7 @@ http://www.gnu.org/software/src-highlite -->
<div class="paragraph"><p>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.</p></div>
-<div class="paragraph"><p>Use <code>gun:head/{2,3}</code> if you don&#8217;t need the response body.</p></div>
+<div class="paragraph"><p>Use <code>gun:head/{2,3,4}</code> if you don&#8217;t need the response body.</p></div>
<div class="listingblock">
<div class="title">HEAD "/organizations/ninenines"</div>
<div class="content"><!-- Generator: GNU source-highlight 3.1.8
@@ -168,7 +168,7 @@ request body. The PATCH method can be used when this is not
desirable. The request body of a PATCH method may be a partial
representation or a list of instructions on how to update the
resource.</p></div>
-<div class="paragraph"><p>The <code>gun:post/4</code>, <code>gun:put/4</code> and <code>gun:patch/4</code> functions
+<div class="paragraph"><p>The <code>gun:post/{4,5}</code>, <code>gun:put/{4,5}</code> and <code>gun:patch/{4,5}</code> 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.
@@ -237,7 +237,7 @@ http://www.gnu.org/software/src-highlite -->
</div>
<div class="sect3">
<h4 id="_delete">DELETE</h4>
-<div class="paragraph"><p>Use <code>gun:delete/{2,3}</code> to delete a resource.</p></div>
+<div class="paragraph"><p>Use <code>gun:delete/{2,3,4}</code> to delete a resource.</p></div>
<div class="listingblock">
<div class="title">DELETE "/organizations/ninenines"</div>
<div class="content"><!-- Generator: GNU source-highlight 3.1.8
@@ -286,7 +286,7 @@ http://www.gnu.org/software/src-highlite -->
</div>
<div class="sect3">
<h4 id="_requests_with_an_arbitrary_method">Requests with an arbitrary method</h4>
-<div class="paragraph"><p>The <code>gun:request/{4,5}</code> function can be used to send requests
+<div class="paragraph"><p>The <code>gun:request/{4,5,6}</code> 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.</p></div>
<div class="listingblock">
@@ -444,6 +444,21 @@ http://www.gnu.org/software/src-highlite -->
<pre><tt><span style="font-weight: bold"><span style="color: #000000">gun:flush</span></span>(<span style="color: #009900">StreamRef</span>)<span style="color: #990000">.</span></tt></pre></div></div>
</div>
</div>
+<div class="sect1">
+<h2 id="_redirecting_responses_to_a_different_process">Redirecting responses to a different process</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>Gun allows you to specify which process will handle responses
+to a request via the <code>reply_to</code> request option.</p></div>
+<div class="listingblock">
+<div class="title">GET "/organizations/ninenines" to a different process</div>
+<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt><span style="color: #009900">StreamRef</span> <span style="color: #990000">=</span> <span style="font-weight: bold"><span style="color: #000000">gun:get</span></span>(<span style="color: #009900">ConnPid</span>, <span style="color: #FF0000">"/organizations/ninenines"</span>, [],
+ #{<span style="color: #0000FF">reply_to</span> <span style="color: #990000">=&gt;</span> <span style="color: #009900">Pid</span>})<span style="color: #990000">.</span></tt></pre></div></div>
+</div>
+</div>
@@ -527,7 +542,6 @@ http://www.gnu.org/software/src-highlite -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
- <script src="/js/bootstrap-carousel.js"></script>
<script src="/js/bootstrap-dropdown.js"></script>
<script src="/js/custom.js"></script>
</body>
diff --git a/docs/en/gun/1.0/guide/index.html b/docs/en/gun/1.0/guide/index.html
index 9348953a..3b22fb4d 100644
--- a/docs/en/gun/1.0/guide/index.html
+++ b/docs/en/gun/1.0/guide/index.html
@@ -165,7 +165,6 @@
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
- <script src="/js/bootstrap-carousel.js"></script>
<script src="/js/bootstrap-dropdown.js"></script>
<script src="/js/custom.js"></script>
</body>
diff --git a/docs/en/gun/1.0/guide/introduction/index.html b/docs/en/gun/1.0/guide/introduction/index.html
index 5dfc3d5f..8b1ae1c4 100644
--- a/docs/en/gun/1.0/guide/introduction/index.html
+++ b/docs/en/gun/1.0/guide/introduction/index.html
@@ -182,7 +182,6 @@ names.</p></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
- <script src="/js/bootstrap-carousel.js"></script>
<script src="/js/bootstrap-dropdown.js"></script>
<script src="/js/custom.js"></script>
</body>
diff --git a/docs/en/gun/1.0/guide/protocols.asciidoc b/docs/en/gun/1.0/guide/protocols.asciidoc
index 2180c5b4..5e3b273e 100644
--- a/docs/en/gun/1.0/guide/protocols.asciidoc
+++ b/docs/en/gun/1.0/guide/protocols.asciidoc
@@ -10,7 +10,7 @@ sends a request, the server sends back a response.
Gun provides convenience functions for performing GET, HEAD,
OPTIONS, POST, PATCH, PUT, and DELETE requests. All these
-functions are aliases of `gun:request/{4,5}` for each respective
+functions are aliases of `gun:request/{4,5,6}` for each respective
methods. Gun also provides a `gun:data/4` function for streaming
the request body.
diff --git a/docs/en/gun/1.0/guide/protocols/index.html b/docs/en/gun/1.0/guide/protocols/index.html
index f2ac3780..2bdbfa3f 100644
--- a/docs/en/gun/1.0/guide/protocols/index.html
+++ b/docs/en/gun/1.0/guide/protocols/index.html
@@ -78,7 +78,7 @@ operations available to them.</p></div>
sends a request, the server sends back a response.</p></div>
<div class="paragraph"><p>Gun provides convenience functions for performing GET, HEAD,
OPTIONS, POST, PATCH, PUT, and DELETE requests. All these
-functions are aliases of <code>gun:request/{4,5}</code> for each respective
+functions are aliases of <code>gun:request/{4,5,6}</code> for each respective
methods. Gun also provides a <code>gun:data/4</code> function for streaming
the request body.</p></div>
<div class="paragraph"><p>Gun will send a <code>gun_response</code> message for every response
@@ -405,7 +405,6 @@ cellspacing="0" cellpadding="4">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
- <script src="/js/bootstrap-carousel.js"></script>
<script src="/js/bootstrap-dropdown.js"></script>
<script src="/js/custom.js"></script>
</body>
diff --git a/docs/en/gun/1.0/guide/start/index.html b/docs/en/gun/1.0/guide/start/index.html
index 2f84cfe9..3505a740 100644
--- a/docs/en/gun/1.0/guide/start/index.html
+++ b/docs/en/gun/1.0/guide/start/index.html
@@ -224,7 +224,6 @@ between the elements of the list.</p></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
- <script src="/js/bootstrap-carousel.js"></script>
<script src="/js/bootstrap-dropdown.js"></script>
<script src="/js/custom.js"></script>
</body>
diff --git a/docs/en/gun/1.0/guide/websocket.asciidoc b/docs/en/gun/1.0/guide/websocket.asciidoc
index 4869a2e4..f99dea70 100644
--- a/docs/en/gun/1.0/guide/websocket.asciidoc
+++ b/docs/en/gun/1.0/guide/websocket.asciidoc
@@ -64,6 +64,10 @@ after 1000 ->
exit(timeout)
end.
+Note that you shouldn't use the `reply_to` request option
+for connections you plan to upgrade, because only the
+owner of the connection will receive messages about it.
+
=== Sending data
Once the Websocket upgrade has completed successfully, you no
diff --git a/docs/en/gun/1.0/guide/websocket/index.html b/docs/en/gun/1.0/guide/websocket/index.html
index 44ec4277..fb0a01bb 100644
--- a/docs/en/gun/1.0/guide/websocket/index.html
+++ b/docs/en/gun/1.0/guide/websocket/index.html
@@ -133,6 +133,9 @@ http://www.gnu.org/software/src-highlite -->
<span style="font-weight: bold"><span style="color: #0000FF">after</span></span> <span style="color: #993399">1000</span> <span style="color: #990000">-&gt;</span>
<span style="font-weight: bold"><span style="color: #000080">exit</span></span>(<span style="color: #FF6600">timeout</span>)
<span style="font-weight: bold"><span style="color: #0000FF">end</span></span><span style="color: #990000">.</span></tt></pre></div></div>
+<div class="paragraph"><p>Note that you shouldn&#8217;t use the <code>reply_to</code> request option
+for connections you plan to upgrade, because only the
+owner of the connection will receive messages about it.</p></div>
</div>
</div>
<div class="sect1">
@@ -267,7 +270,6 @@ message.</p></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
- <script src="/js/bootstrap-carousel.js"></script>
<script src="/js/bootstrap-dropdown.js"></script>
<script src="/js/custom.js"></script>
</body>