summaryrefslogtreecommitdiffstats
path: root/docs/en/cowboy/2.2/manual/cowboy_rest/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'docs/en/cowboy/2.2/manual/cowboy_rest/index.html')
-rw-r--r--docs/en/cowboy/2.2/manual/cowboy_rest/index.html68
1 files changed, 35 insertions, 33 deletions
diff --git a/docs/en/cowboy/2.2/manual/cowboy_rest/index.html b/docs/en/cowboy/2.2/manual/cowboy_rest/index.html
index 3f8ffab8..a7c58ecf 100644
--- a/docs/en/cowboy/2.2/manual/cowboy_rest/index.html
+++ b/docs/en/cowboy/2.2/manual/cowboy_rest/index.html
@@ -69,7 +69,7 @@
<p>Implementing REST handlers is not enough to provide a REST interface; this interface must also follow the REST constraints including HATEOAS (hypermedia as the engine of application state).</p>
<h2 id="_callbacks">Callbacks</h2>
<p>REST handlers implement the following interface:</p>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -110,7 +110,7 @@ http://www.gnu.org/software/src-highlite -->
</dl>
<h2 id="_rest_callbacks">REST callbacks</h2>
<h3 id="_acceptcallback">AcceptCallback</h3>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -126,7 +126,7 @@ http://www.gnu.org/software/src-highlite -->
<p>For PATCH requests, the body is a series of instructions on how to update the resource. Patch files or JSON Patch are examples of such media types.</p>
<p>A response body may be sent. The appropriate media type, charset and language for the response can be retrieved from the Req object using the <code>media_type</code>, <code>charset</code> and <code>language</code> keys, respectively. The body can be set using <a href="../cowboy_req.set_resp_body">cowboy_req:set_resp_body(3)</a>.</p>
<h3 id="_allowed_methods">allowed_methods</h3>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -137,7 +137,7 @@ http://www.gnu.org/software/src-highlite -->
</div></div>
<p>Return the list of allowed methods.</p>
<h3 id="_allow_missing_post">allow_missing_post</h3>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -149,7 +149,7 @@ http://www.gnu.org/software/src-highlite -->
<p>Return whether POST is allowed when the resource doesn&apos;t exist.</p>
<p>Returning <code>true</code> here means that a new resource will be created. The URI for the newly created resource should be returned from the <code>AcceptCallback</code> function.</p>
<h3 id="_charsets_provided">charsets_provided</h3>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -162,7 +162,7 @@ http://www.gnu.org/software/src-highlite -->
<p>During content negotiation Cowboy will pick the most appropriate charset for the client. The client advertises charsets it prefers with the accept-charset header. When that header is missing, Cowboy picks the first charset from the resource.</p>
<!-- @todo We should explain precisely how charsets are picked.-->
<p>Cowboy will add the negotiated <code>charset</code> to the Req object after this step completes:</p>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -171,7 +171,7 @@ http://www.gnu.org/software/src-highlite -->
}</tt></pre>
</div></div>
<h3 id="_content_types_accepted">content_types_accepted</h3>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -200,7 +200,7 @@ http://www.gnu.org/software/src-highlite -->
<!-- what the method is with `cowboy_req:method/1` and return a-->
<!-- different list for each methods.-->
<h3 id="_content_types_provided">content_types_provided</h3>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -225,7 +225,7 @@ http://www.gnu.org/software/src-highlite -->
<p>An empty parameters list <code>[]</code> means that no parameters will be accepted. When any parameter is acceptable, the tuple form should be used with parameters as the atom <code>&apos;*&apos;</code>.</p>
<p>Cowboy treats all parameters as case sensitive, except for the <code>charset</code> parameter, which is known to be case insensitive. You should therefore always provide the charset as a lowercase binary string.</p>
<p>Cowboy will add the negotiated <code>media_type</code> to the Req object after this step completes:</p>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -235,7 +235,7 @@ http://www.gnu.org/software/src-highlite -->
</div></div>
<!-- @todo Case sensitivity of parsed mime content?-->
<h3 id="_delete_completed">delete_completed</h3>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -247,7 +247,7 @@ http://www.gnu.org/software/src-highlite -->
<p>Return whether the resource has been fully deleted from the system, including from any internal cache.</p>
<p>Returning <code>false</code> will result in a <em>202 Accepted</em> response being sent instead of a <em>200 OK</em> or <em>204 No Content</em>.</p>
<h3 id="_delete_resource">delete_resource</h3>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -259,7 +259,7 @@ http://www.gnu.org/software/src-highlite -->
<p>Delete the resource.</p>
<p>Cowboy will send an error response when this function returns <code>false</code>.</p>
<h3 id="_expires">expires</h3>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><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 -->
</div></div>
<p>Return the resource&apos;s expiration date.</p>
<h3 id="_forbidden">forbidden</h3>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -282,7 +282,7 @@ http://www.gnu.org/software/src-highlite -->
<p>Return whether access to the resource is forbidden.</p>
<p>A <em>403 Forbidden</em> response will be sent if this function returns <code>true</code>. This status code means that access is forbidden regardless of authentication, and that the request shouldn&apos;t be repeated.</p>
<h3 id="_generate_etag">generate_etag</h3>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -294,7 +294,7 @@ http://www.gnu.org/software/src-highlite -->
<p>Return the entity tag of the resource.</p>
<p>When a binary is returned, the value is automatically parsed to a tuple. The binary must be in the same format as the etag header, including quotes.</p>
<h3 id="_is_authorized">is_authorized</h3>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -307,7 +307,7 @@ http://www.gnu.org/software/src-highlite -->
<p>This function should be used to perform any necessary authentication of the user before attempting to perform any action on the resource.</p>
<p>When authentication fails, the <code>AuthHeader</code> value will be sent in the www-authenticate header for the <em>401 Unauthorized</em> response.</p>
<h3 id="_is_conflict">is_conflict</h3>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -319,7 +319,7 @@ http://www.gnu.org/software/src-highlite -->
<p>Return whether the PUT request results in a conflict.</p>
<p>A <em>409 Conflict</em> response is sent when <code>true</code>.</p>
<h3 id="_known_methods">known_methods</h3>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -333,7 +333,7 @@ http://www.gnu.org/software/src-highlite -->
<p>The full list of methods known by the server should be returned, regardless of their use in the resource.</p>
<p>The default value lists the methods Cowboy knows and implement in <code>cowboy_rest</code>.</p>
<h3 id="_languages_provided">languages_provided</h3>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -346,7 +346,7 @@ http://www.gnu.org/software/src-highlite -->
<p>During content negotiation Cowboy will pick the most appropriate language for the client. The client advertises languages it prefers with the accept-language header. When that header is missing, Cowboy picks the first language from the resource.</p>
<!-- @todo We should explain precisely how languages are picked.-->
<p>Cowboy will add the negotiated <code>language</code> to the Req object after this step completes:</p>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -355,7 +355,7 @@ http://www.gnu.org/software/src-highlite -->
}</tt></pre>
</div></div>
<h3 id="_last_modified">last_modified</h3>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -367,7 +367,7 @@ http://www.gnu.org/software/src-highlite -->
<p>Return the resource&apos;s last modification date.</p>
<p>This date will be used to test against the if-modified-since and if-unmodified-since headers, and sent as the last-modified header in the response to GET and HEAD requests.</p>
<h3 id="_malformed_request">malformed_request</h3>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -379,7 +379,7 @@ http://www.gnu.org/software/src-highlite -->
<p>Return whether the request is malformed.</p>
<p>A request is malformed when a component required by the resource is invalid. This may include the query string or individual headers. They should be parsed and validated in this function. The body should not be read at this point.</p>
<h3 id="_moved_permanently">moved_permanently</h3>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -390,7 +390,7 @@ http://www.gnu.org/software/src-highlite -->
</div></div>
<p>Return whether the resource was permanently moved, and what its new location is.</p>
<h3 id="_moved_temporarily">moved_temporarily</h3>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -401,7 +401,7 @@ http://www.gnu.org/software/src-highlite -->
</div></div>
<p>Return whether the resource was temporarily moved, and what its new location is.</p>
<h3 id="_multiple_choices">multiple_choices</h3>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -414,7 +414,7 @@ http://www.gnu.org/software/src-highlite -->
<p>Return <code>true</code> when the server has multiple representations of a resource, each with their specific identifier, but is unable to determine which is best for the client. For example an image might have different sizes and the server is unable to determine the capabilities of the client.</p>
<p>When returning <code>true</code> the server should send a body with links to the different representations. If the server has a preferred representation it can send its link inside a location header.</p>
<h3 id="_options">options</h3>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -423,7 +423,7 @@ http://www.gnu.org/software/src-highlite -->
<p>Respond to an OPTIONS request.</p>
<p>The response should inform the client the communication options available for this resource. By default Cowboy will send a <em>200 OK</em> response with the allow header set.</p>
<h3 id="_previously_existed">previously_existed</h3>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -434,7 +434,7 @@ http://www.gnu.org/software/src-highlite -->
</div></div>
<p>Return whether the resource existed previously.</p>
<h3 id="_providecallback">ProvideCallback</h3>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -452,7 +452,7 @@ http://www.gnu.org/software/src-highlite -->
<p>Note that there used to be a way to stream the response body. It was temporarily removed and will be added back in a later release.</p>
<!-- @todo Add a way to switch to loop handler for streaming the body.-->
<h3 id="_resource_exists">resource_exists</h3>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -463,7 +463,7 @@ http://www.gnu.org/software/src-highlite -->
</div></div>
<p>Return whether the resource exists.</p>
<h3 id="_service_available">service_available</h3>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -475,7 +475,7 @@ http://www.gnu.org/software/src-highlite -->
<p>Return whether the service is available.</p>
<p>A <em>503 Service Unavailable</em> response will be sent when this function returns <code>false</code>.</p>
<h3 id="_uri_too_long">uri_too_long</h3>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -487,7 +487,7 @@ http://www.gnu.org/software/src-highlite -->
<p>Return whether the requested URI is too long.</p>
<p>This function can be used to further restrict the length of the URI for this specific resource.</p>
<h3 id="_valid_content_headers">valid_content_headers</h3>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -499,7 +499,7 @@ http://www.gnu.org/software/src-highlite -->
<p>Return whether the content headers are valid.</p>
<p>This callback can be used to reject requests that have invalid content header values, for example an unsupported content-encoding.</p>
<h3 id="_valid_entity_length">valid_entity_length</h3>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -511,7 +511,7 @@ http://www.gnu.org/software/src-highlite -->
<p>Return whether the request body length is within acceptable boundaries.</p>
<p>A <em>413 Request Entity Too Large</em> response will be sent if this function returns <code>false</code>.</p>
<h3 id="_variances">variances</h3>
-<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
@@ -565,6 +565,8 @@ http://www.gnu.org/software/src-highlite -->
+ <li><a href="/docs/en/cowboy/2.7/manual">2.7</a></li>
+
<li><a href="/docs/en/cowboy/2.6/manual">2.6</a></li>
<li><a href="/docs/en/cowboy/2.5/manual">2.5</a></li>