summaryrefslogtreecommitdiffstats
path: root/docs/en/gun/1.1/guide/http/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/en/gun/1.1/guide/http/index.html')
-rw-r--r--docs/en/gun/1.1/guide/http/index.html42
1 files changed, 21 insertions, 21 deletions
diff --git a/docs/en/gun/1.1/guide/http/index.html b/docs/en/gun/1.1/guide/http/index.html
index 59cfb9a1..1c69ca27 100644
--- a/docs/en/gun/1.1/guide/http/index.html
+++ b/docs/en/gun/1.1/guide/http/index.html
@@ -69,7 +69,7 @@
<p>Streams can be canceled at any time. This will stop any further messages from being sent to the owner process. Depending on its capabilities, the server will also be instructed to cancel the request.</p>
<p>Canceling a stream may result in Gun dropping the connection temporarily, to avoid uploading or downloading data that will not be used.</p>
<div class="listingblock"><div class="title">Cancelling a stream</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -83,14 +83,14 @@ http://www.gnu.org/software/src-highlite -->
<h4 id="_get_and_head">GET and HEAD</h4>
<p>Use <code>gun:get/2,3,4</code> to request a resource.</p>
<div class="listingblock"><div class="title">GET &quot;/organizations/ninenines&quot;</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><font color="#009900">StreamRef</font> <font color="#990000">=</font> <b><font color="#000000">gun:get</font></b>(<font color="#009900">ConnPid</font>, <font color="#FF0000">"/organizations/ninenines"</font>)<font color="#990000">.</font></tt></pre>
</div></div>
<div class="listingblock"><div class="title">GET &quot;/organizations/ninenines&quot; with custom headers</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -102,14 +102,14 @@ http://www.gnu.org/software/src-highlite -->
<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>
<p>Use <code>gun:head/2,3,4</code> if you don&apos;t need the response body.</p>
<div class="listingblock"><div class="title">HEAD &quot;/organizations/ninenines&quot;</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><font color="#009900">StreamRef</font> <font color="#990000">=</font> <b><font color="#000000">gun:head</font></b>(<font color="#009900">ConnPid</font>, <font color="#FF0000">"/organizations/ninenines"</font>)<font color="#990000">.</font></tt></pre>
</div></div>
<div class="listingblock"><div class="title">HEAD &quot;/organizations/ninenines&quot; with custom headers</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -128,7 +128,7 @@ http://www.gnu.org/software/src-highlite -->
<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. Gun will set the other headers automatically.</p>
<p>In this and the following examples in this section, <code>gun:post</code> can be replaced by <code>gun:put</code> or <code>gun:patch</code> for performing a PUT or PATCH request, respectively.</p>
<div class="listingblock"><div class="title">POST &quot;/organizations/ninenines&quot;</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -140,7 +140,7 @@ http://www.gnu.org/software/src-highlite -->
<p>The <code>gun:post/3</code>, <code>gun:put/3</code> and <code>gun:patch/3</code> functions do not take a body in their arguments. If a body is to be provided later on, using the <code>gun:data/4</code> 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.</p>
<p>It is recommended to send the content-length header if you know it in advance, although this is not required. If it is not set, HTTP/1.1 will use the chunked transfer-encoding, and HTTP/2 will continue normally as it is chunked by design.</p>
<div class="listingblock"><div class="title">POST &quot;/organizations/ninenines&quot; with delayed body</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -153,7 +153,7 @@ http://www.gnu.org/software/src-highlite -->
</div></div>
<p>The atom <code>fin</code> indicates this is the last chunk of data to be sent. You can call the <code>gun:data/4</code> function as many times as needed until you have sent the entire body. The last call must use <code>fin</code> and all the previous calls must use <code>nofin</code>. The last chunk may be empty.</p>
<div class="listingblock"><div class="title">Streaming the request body</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -174,14 +174,14 @@ http://www.gnu.org/software/src-highlite -->
<h4 id="_delete">DELETE</h4>
<p>Use <code>gun:delete/2,3,4</code> to delete a resource.</p>
<div class="listingblock"><div class="title">DELETE &quot;/organizations/ninenines&quot;</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><font color="#009900">StreamRef</font> <font color="#990000">=</font> <b><font color="#000000">gun:delete</font></b>(<font color="#009900">ConnPid</font>, <font color="#FF0000">"/organizations/ninenines"</font>)<font color="#990000">.</font></tt></pre>
</div></div>
<div class="listingblock"><div class="title">DELETE &quot;/organizations/ninenines&quot; with custom headers</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -192,14 +192,14 @@ http://www.gnu.org/software/src-highlite -->
<h4 id="_options">OPTIONS</h4>
<p>Use <code>gun:options/2,3</code> to request information about a resource.</p>
<div class="listingblock"><div class="title">OPTIONS &quot;/organizations/ninenines&quot;</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><font color="#009900">StreamRef</font> <font color="#990000">=</font> <b><font color="#000000">gun:options</font></b>(<font color="#009900">ConnPid</font>, <font color="#FF0000">"/organizations/ninenines"</font>)<font color="#990000">.</font></tt></pre>
</div></div>
<div class="listingblock"><div class="title">OPTIONS &quot;/organizations/ninenines&quot; with custom headers</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -209,7 +209,7 @@ http://www.gnu.org/software/src-highlite -->
</div></div>
<p>You can also use this function to request information about the server itself.</p>
<div class="listingblock"><div class="title">OPTIONS &quot;*&quot;</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -218,7 +218,7 @@ http://www.gnu.org/software/src-highlite -->
<h4 id="_requests_with_an_arbitrary_method">Requests with an arbitrary method</h4>
<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 class="listingblock"><div class="title">Example of a TRACE request</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -232,7 +232,7 @@ http://www.gnu.org/software/src-highlite -->
<p>When using HTTP/2 this value is sent with the frame and simply passed on in the message. When using HTTP/1.1 however Gun must guess whether data will follow by looking at the response headers.</p>
<p>You can receive messages directly, or you can use the <em>await</em> functions to let Gun receive them for you.</p>
<div class="listingblock"><div class="title">Receiving a response using receive</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -270,7 +270,7 @@ http://www.gnu.org/software/src-highlite -->
<p>When calling <code>gun:await/2,3</code> and not passing a monitor reference, one is automatically created for you for the duration of the call.</p>
<p>The <code>gun:await_body/2,3,4</code> works similarly, but returns the body received. Both functions can be combined to receive the response and its body sequentially.</p>
<div class="listingblock"><div class="title">Receiving a response using await</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -288,7 +288,7 @@ http://www.gnu.org/software/src-highlite -->
<p>You can safely choose to ignore <code>gun_push</code> messages, or you can handle them. If you do, you can either receive the messages directly or use <em>await</em> functions.</p>
<p>The <code>gun_push</code> message contains both the new stream reference and the stream reference of the original request.</p>
<div class="listingblock"><div class="title">Receiving a pushed response using receive</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -300,7 +300,7 @@ http://www.gnu.org/software/src-highlite -->
</div></div>
<p>If you use the <code>gun:await/2,3,4</code> function, however, Gun will use the original reference to identify the message but will return a tuple that doesn&apos;t contain it.</p>
<div class="listingblock"><div class="title">Receiving a pushed response using await</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -311,14 +311,14 @@ http://www.gnu.org/software/src-highlite -->
<h2 id="_flushing_unwanted_messages">Flushing unwanted messages</h2>
<p>Gun provides the function <code>gun:flush/1</code> to quickly get rid of unwanted messages sitting in the process mailbox. You can use it to get rid of all messages related to a connection, or just the messages related to a stream.</p>
<div class="listingblock"><div class="title">Flush all messages from a Gun connection</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">gun:flush</font></b>(<font color="#009900">ConnPid</font>)<font color="#990000">.</font></tt></pre>
</div></div>
<div class="listingblock"><div class="title">Flush all messages from a specific stream</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -327,7 +327,7 @@ http://www.gnu.org/software/src-highlite -->
<h2 id="_redirecting_responses_to_a_different_process">Redirecting responses to a different process</h2>
<p>Gun allows you to specify which process will handle responses to a request via the <code>reply_to</code> request option.</p>
<div class="listingblock"><div class="title">GET &quot;/organizations/ninenines&quot; to a different process</div>
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->