summaryrefslogtreecommitdiffstats
path: root/docs/en/cowboy/2.5/manual/cowboy_rest/index.html
blob: 6e0804fea065a285c9a513fba67433507f6fe937 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="Loïc Hoguin based on a design from (Soft10) Pol Cámara">

    <title>Nine Nines: cowboy_rest(3)</title>

    <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic' rel='stylesheet' type='text/css'>
    <link href="/css/99s.css?r=7" rel="stylesheet">

    <link rel="shortcut icon" href="/img/ico/favicon.ico">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/img/ico/apple-touch-icon-114.png">
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/img/ico/apple-touch-icon-72.png">
    <link rel="apple-touch-icon-precomposed" href="/img/ico/apple-touch-icon-57.png">

    
</head>


<body class="">
  <header id="page-head">
    <div id="topbar" class="container">
        <div class="row">
          <div class="span2">
            <h1 id="logo"><a href="/" title="99s">99s</a></h1>
          </div>
          <div class="span10">
            
            <div id="side-header">
              <nav>
                <ul>
                  <li><a title="Hear my thoughts" href="/articles">Articles</a></li>
  				  <li><a title="Watch my talks" href="/talks">Talks</a></li>
  				  <li class="active"><a title="Read the docs" href="/docs">Documentation</a></li>
  				  <li><a title="Request my services" href="/services">Consulting & Training</a></li>
                </ul>
              </nav> 
              <ul id="social">
                <li>
                  <a href="https://github.com/ninenines" title="Check my Github repositories"><img src="/img/ico_github.png" data-hover="/img/ico_github_alt.png" alt="Github"></a>
                </li>
                    <li>
						<a title="Contact me" href="mailto:[email protected]"><img src="/img/ico_mail.png" data-hover="/img/ico_mail_alt.png"></a>
					</li>
              </ul>
            </div>
          </div>
        </div>
    </div>


</header>

<div id="contents" class="two_col">
<div class="container">
<div class="row">
<div id="docs" class="span9 maincol">

<h1 class="lined-header"><span>cowboy_rest(3)</span></h1>

<h2 id="_name">Name</h2>
<p>cowboy_rest - REST handlers</p>
<h2 id="_description">Description</h2>
<p>The module <code>cowboy_rest</code> implements the HTTP state machine.</p>
<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.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">init</font></b>(<font color="#009900">Req</font>, <font color="#009900">State</font>)
    <font color="#990000">-&gt;</font> {<font color="#FF6600">cowboy_rest</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}

<font color="#009900">Callback</font>(<font color="#009900">Req</font>, <font color="#009900">State</font>)
    <font color="#990000">-&gt;</font> {<font color="#009900">Result</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}
     | {<font color="#FF6600">stop</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}
     | {{<font color="#FF6600">switch_handler</font>, <font color="#009900">Module</font>}, <font color="#009900">Req</font>, <font color="#009900">State</font>}
     | {{<font color="#FF6600">switch_handler</font>, <font color="#009900">Module</font>, <font color="#009900">Opts</font>}, <font color="#009900">Req</font>, <font color="#009900">State</font>}

<b><font color="#000000">terminate</font></b>(<font color="#009900">Reason</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>) <font color="#990000">-&gt;</font> <font color="#FF6600">ok</font>  <i><font color="#9A1900">%% optional</font></i>

<font color="#009900">Req</font>    <font color="#990000">::</font> <b><font color="#000000">cowboy_req:req</font></b>()
<font color="#009900">State</font>  <font color="#990000">::</font> <b><font color="#000000">any</font></b>()
<font color="#009900">Module</font> <font color="#990000">::</font> <b><font color="#000000">module</font></b>()
<font color="#009900">Opts</font>   <font color="#990000">::</font> <b><font color="#000000">any</font></b>()
<font color="#009900">Reason</font> <font color="#990000">::</font> <b><font color="#000080">normal</font></b>
        | {<font color="#FF6600">crash</font>, <font color="#FF6600">error</font> | <b><font color="#000080">exit</font></b> | <b><font color="#000080">throw</font></b>, <b><font color="#000000">any</font></b>()}

<font color="#009900">Callback</font> <font color="#990000">-</font> <font color="#FF6600">see</font> <font color="#FF6600">below</font>
<font color="#009900">Result</font>   <font color="#990000">-</font> <font color="#FF6600">see</font> <font color="#FF6600">below</font>
<font color="#009900">Default</font>  <font color="#990000">-</font> <font color="#FF6600">see</font> <font color="#FF6600">below</font></tt></pre>
</div></div>
<p>The <code>init/2</code> callback is common to all handlers. To switch to the REST handler behavior, it must return <code>cowboy_rest</code> as the first element of the tuple.</p>
<p>The <code>Callback/2</code> above represents all the REST-specific callbacks. They are described in the following section of this manual. REST-specific callbacks differ by their name, semantics, result and default values. The default value is the one used when the callback has not been implemented. They otherwise all follow the same interface.</p>
<p>The <code>stop</code> tuple can be returned to stop REST processing. If no response was sent before then, Cowboy will send a <em>204 No Content</em>. The <code>stop</code> tuple can be returned from any callback, excluding <code>expires</code>, <code>generate_etag</code>, <code>last_modified</code> and <code>variances</code>.</p>
<p>A <code>switch_handler</code> tuple can be returned from these same callbacks to stop REST processing and switch to a different handler type. This is very useful to, for example, to stream the response body.</p>
<p>The optional <code>terminate/3</code> callback will ultimately be called with the reason for the termination of the handler. Cowboy will terminate the process right after this. There is no need to perform any cleanup in this callback.</p>
<p>The following terminate reasons are defined for loop handlers:</p>
<dl><dt>normal</dt>
<dd><p>The handler terminated normally.</p>
</dd>
<dt>{crash, Class, Reason}</dt>
<dd><p>A crash occurred in the handler. <code>Class</code> and <code>Reason</code> can be used to obtain more information about the crash. The function <code>erlang:get_stacktrace/0</code> can also be called to obtain the stacktrace of the process when the crash occurred.</p>
</dd>
</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.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><font color="#009900">AcceptCallback</font>(<font color="#009900">Req</font>, <font color="#009900">State</font>) <font color="#990000">-&gt;</font> {<font color="#009900">Result</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}

<font color="#009900">Result</font>  <font color="#990000">::</font> <font color="#000080">true</font> | {<font color="#000080">true</font>, <font color="#009900">URI</font> <font color="#990000">::</font> <b><font color="#000000">iodata</font></b>()} | <font color="#000080">false</font>}
<font color="#009900">Default</font>  <font color="#990000">-</font> <font color="#FF6600">crash</font></tt></pre>
</div></div>
<p>Process the request body.</p>
<p>This function should create or update the resource using the request body.</p>
<p>For PUT requests, the body is a representation of the resource that is being created or replaced.</p>
<p>For POST requests, the body is typically application-specific instructions on how to process the request, but it may also be a representation of the resource. When creating a new resource with POST at a different location, return <code>{true, URI}</code> with <code>URI</code> the new location.</p>
<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.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">allowed_methods</font></b>(<font color="#009900">Req</font>, <font color="#009900">State</font>) <font color="#990000">-&gt;</font> {<font color="#009900">Result</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}

<font color="#009900">Result</font>  <font color="#990000">::</font> [<b><font color="#000080">binary</font></b>()]  <i><font color="#9A1900">%% case sensitive</font></i>
<font color="#009900">Default</font> <font color="#990000">::</font> [<font color="#990000">&lt;&lt;</font><font color="#FF0000">"GET"</font><font color="#990000">&gt;&gt;</font>, <font color="#990000">&lt;&lt;</font><font color="#FF0000">"HEAD"</font><font color="#990000">&gt;&gt;</font>, <font color="#990000">&lt;&lt;</font><font color="#FF0000">"OPTIONS"</font><font color="#990000">&gt;&gt;</font>]</tt></pre>
</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.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">allow_missing_post</font></b>(<font color="#009900">Req</font>, <font color="#009900">State</font>) <font color="#990000">-&gt;</font> {<font color="#009900">Result</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}

<font color="#009900">Result</font>  <font color="#990000">::</font> <b><font color="#000000">boolean</font></b>()
<font color="#009900">Default</font> <font color="#990000">::</font> <font color="#000080">true</font></tt></pre>
</div></div>
<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.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">charsets_provided</font></b>(<font color="#009900">Req</font>, <font color="#009900">State</font>) <font color="#990000">-&gt;</font> {<font color="#009900">Result</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}

<font color="#009900">Result</font>  <font color="#990000">::</font> [<b><font color="#000080">binary</font></b>()]  <i><font color="#9A1900">%% lowercase; case insensitive</font></i>
<font color="#009900">Default</font>  <font color="#990000">-</font> <font color="#FF6600">skip</font> <font color="#FF6600">this</font> <font color="#FF6600">step</font></tt></pre>
</div></div>
<p>Return the list of charsets the resource provides in order of preference.</p>
<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.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">req</font></b>() <font color="#990000">::</font> #{
    <font color="#0000FF">charset</font> <font color="#990000">=&gt;</font> <b><font color="#000080">binary</font></b>()  <i><font color="#9A1900">%% lowercase; case insensitive</font></i>
}</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.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">content_types_accepted</font></b>(<font color="#009900">Req</font>, <font color="#009900">State</font>) <font color="#990000">-&gt;</font> {<font color="#009900">Result</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}

<font color="#009900">Result</font>     <font color="#990000">::</font> [{<b><font color="#000080">binary</font></b>() | <font color="#009900">ParsedMime</font>, <font color="#009900">AcceptCallback</font> <font color="#990000">::</font> <b><font color="#000080">atom</font></b>()}]
<font color="#009900">ParsedMime</font> <font color="#990000">::</font> {<font color="#009900">Type</font> <font color="#990000">::</font> <b><font color="#000080">binary</font></b>(), <font color="#009900">SubType</font> <font color="#990000">::</font> <b><font color="#000080">binary</font></b>(), <font color="#FF6600">'*'</font> | <font color="#009900">Params</font>}
<font color="#009900">Params</font>     <font color="#990000">::</font> [{<font color="#009900">Key</font> <font color="#990000">::</font> <b><font color="#000080">binary</font></b>(), <font color="#009900">Value</font> <font color="#990000">::</font> <b><font color="#000080">binary</font></b>()}]

<font color="#009900">Default</font>     <font color="#990000">-</font> <font color="#FF6600">crash</font></tt></pre>
</div></div>
<!-- @todo Case sensitivity of parsed mime content?-->
<p>Return the list of media types the resource accepts in order of preference.</p>
<p>A media type is made of different parts. The media type <code>text/html;charset=utf-8</code> is of type <code>text</code>, subtype <code>html</code> and has a single parameter <code>charset</code> with value <code>utf-8</code>.</p>
<!-- @todo Cowboy needs to ignore the boundary parameter for-->
<!-- multipart, as we never want to match against it. Or allow-->
<!-- ignoring specific parameters at the very least.-->
<p>Cowboy will match the content-type request header against the media types the server accepts and select the appropriate callback. When that header is missing, or when the server does not accept this media type, the request fails and an error response is returned. Cowboy will execute the callback immediately otherwise.</p>
<!-- @todo We should explain precisely how media types are picked.-->
<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>
<!-- @todo Maybe this should be in the user guide instead.-->
<!-- This function will be called for POST, PUT and PATCH requests.-->
<!-- It is entirely possible to define different callbacks for different-->
<!-- methods if the handling of the request differs. Simply verify-->
<!-- 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.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">content_types_provided</font></b>(<font color="#009900">Req</font>, <font color="#009900">State</font>) <font color="#990000">-&gt;</font> {<font color="#009900">Result</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}

<font color="#009900">Result</font>     <font color="#990000">::</font> [{<b><font color="#000080">binary</font></b>() | <font color="#009900">ParsedMime</font>, <font color="#009900">ProvideCallback</font> <font color="#990000">::</font> <b><font color="#000080">atom</font></b>()}]
<font color="#009900">ParsedMime</font> <font color="#990000">::</font> {<font color="#009900">Type</font> <font color="#990000">::</font> <b><font color="#000080">binary</font></b>(), <font color="#009900">SubType</font> <font color="#990000">::</font> <b><font color="#000080">binary</font></b>(), <font color="#FF6600">'*'</font> | <font color="#009900">Params</font>}
<font color="#009900">Params</font>     <font color="#990000">::</font> [{<font color="#009900">Key</font> <font color="#990000">::</font> <b><font color="#000080">binary</font></b>(), <font color="#009900">Value</font> <font color="#990000">::</font> <b><font color="#000080">binary</font></b>()}]

<font color="#009900">Default</font>     <font color="#990000">-</font> [{{ <font color="#990000">&lt;&lt;</font><font color="#FF0000">"text"</font><font color="#990000">&gt;&gt;</font>, <font color="#990000">&lt;&lt;</font><font color="#FF0000">"html"</font><font color="#990000">&gt;&gt;</font>, <font color="#FF6600">'*'</font>}, <font color="#FF6600">to_html</font>}]</tt></pre>
</div></div>
<!-- @todo Case sensitivity of parsed mime content?-->
<!-- @todo Space required for the time being: https://github.com/spf13/hugo/issues/2398-->
<p>Return the list of media types the resource provides in order of preference.</p>
<p>A media type is made of different parts. The media type <code>text/html;charset=utf-8</code> is of type <code>text</code>, subtype <code>html</code> and has a single parameter <code>charset</code> with value <code>utf-8</code>.</p>
<!-- @todo Cowboy needs to ignore the boundary parameter for-->
<!-- multipart, as we never want to match against it. Or allow-->
<!-- ignoring specific parameters at the very least.-->
<p>During content negotiation Cowboy will pick the most appropriate media type for the client. The client advertises media types it prefers with the accept header. When that header is missing, the content negotiation fails and an error response is returned.</p>
<p>The callback given for the selected media type will be called at the end of the execution of GET and HEAD requests when a representation must be sent to the client.</p>
<!-- @todo We should explain precisely how media types are picked.-->
<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.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">req</font></b>() <font color="#990000">::</font> #{
    <font color="#0000FF">media_type</font> <font color="#990000">=&gt;</font> <font color="#009900">ParsedMime</font>
}</tt></pre>
</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.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">delete_completed</font></b>(<font color="#009900">Req</font>, <font color="#009900">State</font>) <font color="#990000">-&gt;</font> {<font color="#009900">Result</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}

<font color="#009900">Result</font>  <font color="#990000">::</font> <b><font color="#000000">boolean</font></b>()
<font color="#009900">Default</font> <font color="#990000">::</font> <font color="#000080">true</font></tt></pre>
</div></div>
<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.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">delete_resource</font></b>(<font color="#009900">Req</font>, <font color="#009900">State</font>) <font color="#990000">-&gt;</font> {<font color="#009900">Result</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}

<font color="#009900">Result</font>  <font color="#990000">::</font> <b><font color="#000000">boolean</font></b>()
<font color="#009900">Default</font> <font color="#990000">::</font> <font color="#000080">false</font></tt></pre>
</div></div>
<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.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">expires</font></b>(<font color="#009900">Req</font>, <font color="#009900">State</font>) <font color="#990000">-&gt;</font> {<font color="#009900">Result</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}

<font color="#009900">Result</font>  <font color="#990000">::</font> <b><font color="#000000">calendar:datetime</font></b>() | <b><font color="#000080">binary</font></b>() | <font color="#000080">undefined</font>
<font color="#009900">Default</font> <font color="#990000">::</font> <font color="#000080">undefined</font></tt></pre>
</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.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">forbidden</font></b>(<font color="#009900">Req</font>, <font color="#009900">State</font>) <font color="#990000">-&gt;</font> {<font color="#009900">Result</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}

<font color="#009900">Result</font>  <font color="#990000">::</font> <b><font color="#000000">boolean</font></b>()
<font color="#009900">Default</font> <font color="#990000">::</font> <font color="#000080">false</font></tt></pre>
</div></div>
<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.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">generate_etag</font></b>(<font color="#009900">Req</font>, <font color="#009900">State</font>) <font color="#990000">-&gt;</font> {<font color="#009900">Result</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}

<font color="#009900">Result</font>  <font color="#990000">::</font> <b><font color="#000080">binary</font></b>() | {<font color="#FF6600">weak</font> | <font color="#FF6600">strong</font>, <b><font color="#000080">binary</font></b>()}
<font color="#009900">Default</font>  <font color="#990000">-</font> <font color="#FF6600">no</font> <font color="#FF6600">etag</font> <font color="#FF6600">value</font></tt></pre>
</div></div>
<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.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">is_authorized</font></b>(<font color="#009900">Req</font>, <font color="#009900">State</font>) <font color="#990000">-&gt;</font> {<font color="#009900">Result</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}

<font color="#009900">Result</font>  <font color="#990000">::</font> <font color="#000080">true</font> | {<font color="#000080">false</font>, <font color="#009900">AuthHeader</font> <font color="#990000">::</font> <b><font color="#000000">iodata</font></b>()}
<font color="#009900">Default</font>  <font color="#990000">-</font> <font color="#000080">true</font></tt></pre>
</div></div>
<p>Return whether the user is authorized to perform the action.</p>
<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.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">is_conflict</font></b>(<font color="#009900">Req</font>, <font color="#009900">State</font>) <font color="#990000">-&gt;</font> {<font color="#009900">Result</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}

<font color="#009900">Result</font>  <font color="#990000">::</font> <b><font color="#000000">boolean</font></b>()
<font color="#009900">Default</font> <font color="#990000">::</font> <font color="#000080">false</font></tt></pre>
</div></div>
<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.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">known_methods</font></b>(<font color="#009900">Req</font>, <font color="#009900">State</font>) <font color="#990000">-&gt;</font> {<font color="#009900">Result</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}

<font color="#009900">Result</font>  <font color="#990000">::</font> [<b><font color="#000080">binary</font></b>()]  <i><font color="#9A1900">%% case sensitive</font></i>
<font color="#009900">Default</font> <font color="#990000">::</font> [<font color="#990000">&lt;&lt;</font><font color="#FF0000">"GET"</font><font color="#990000">&gt;&gt;</font>, <font color="#990000">&lt;&lt;</font><font color="#FF0000">"HEAD"</font><font color="#990000">&gt;&gt;</font>, <font color="#990000">&lt;&lt;</font><font color="#FF0000">"POST"</font><font color="#990000">&gt;&gt;</font>, <font color="#990000">&lt;&lt;</font><font color="#FF0000">"PUT"</font><font color="#990000">&gt;&gt;</font>,
            <font color="#990000">&lt;&lt;</font><font color="#FF0000">"PATCH"</font><font color="#990000">&gt;&gt;</font>, <font color="#990000">&lt;&lt;</font><font color="#FF0000">"DELETE"</font><font color="#990000">&gt;&gt;</font>, <font color="#990000">&lt;&lt;</font><font color="#FF0000">"OPTIONS"</font><font color="#990000">&gt;&gt;</font>]</tt></pre>
</div></div>
<p>Return the list of known methods.</p>
<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.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">languages_provided</font></b>(<font color="#009900">Req</font>, <font color="#009900">State</font>) <font color="#990000">-&gt;</font> {<font color="#009900">Result</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}

<font color="#009900">Result</font>  <font color="#990000">::</font> [<b><font color="#000080">binary</font></b>()]  <i><font color="#9A1900">%% lowercase; case insensitive</font></i>
<font color="#009900">Default</font>  <font color="#990000">-</font> <font color="#FF6600">skip</font> <font color="#FF6600">this</font> <font color="#FF6600">step</font></tt></pre>
</div></div>
<p>Return the list of languages the resource provides in order of preference.</p>
<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.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">req</font></b>() <font color="#990000">::</font> #{
    <font color="#0000FF">language</font> <font color="#990000">=&gt;</font> <b><font color="#000080">binary</font></b>()  <i><font color="#9A1900">%% lowercase; case insensitive</font></i>
}</tt></pre>
</div></div>
<h3 id="_last_modified">last_modified</h3>
<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 -->
<pre><tt><b><font color="#000000">last_modified</font></b>(<font color="#009900">Req</font>, <font color="#009900">State</font>) <font color="#990000">-&gt;</font> {<font color="#009900">Result</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}

<font color="#009900">Result</font>  <font color="#990000">::</font> <b><font color="#000000">calendar:datetime</font></b>()
<font color="#009900">Default</font>  <font color="#990000">-</font> <font color="#FF6600">no</font> <font color="#FF6600">last</font> <font color="#FF6600">modified</font> <font color="#FF6600">value</font></tt></pre>
</div></div>
<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.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">malformed_request</font></b>(<font color="#009900">Req</font>, <font color="#009900">State</font>) <font color="#990000">-&gt;</font> {<font color="#009900">Result</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}

<font color="#009900">Result</font>  <font color="#990000">::</font> <b><font color="#000000">boolean</font></b>()
<font color="#009900">Default</font> <font color="#990000">::</font> <font color="#000080">false</font></tt></pre>
</div></div>
<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.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">moved_permanently</font></b>(<font color="#009900">Req</font>, <font color="#009900">State</font>) <font color="#990000">-&gt;</font> {<font color="#009900">Result</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}

<font color="#009900">Result</font>  <font color="#990000">::</font> {<font color="#000080">true</font>, <font color="#009900">URI</font> <font color="#990000">::</font> <b><font color="#000000">iodata</font></b>()} | <font color="#000080">false</font>
<font color="#009900">Default</font> <font color="#990000">::</font> <font color="#000080">false</font></tt></pre>
</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.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">moved_temporarily</font></b>(<font color="#009900">Req</font>, <font color="#009900">State</font>) <font color="#990000">-&gt;</font> {<font color="#009900">Result</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}

<font color="#009900">Result</font>  <font color="#990000">::</font> {<font color="#000080">true</font>, <font color="#009900">URI</font> <font color="#990000">::</font> <b><font color="#000000">iodata</font></b>()} | <font color="#000080">false</font>
<font color="#009900">Default</font> <font color="#990000">::</font> <font color="#000080">false</font></tt></pre>
</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.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">multiple_choices</font></b>(<font color="#009900">Req</font>, <font color="#009900">State</font>) <font color="#990000">-&gt;</font> {<font color="#009900">Result</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}

<font color="#009900">Result</font>  <font color="#990000">::</font> <b><font color="#000000">boolean</font></b>()
<font color="#009900">Default</font> <font color="#990000">::</font> <font color="#000080">false</font></tt></pre>
</div></div>
<p>Return whether the client should engage in reactive negotiation.</p>
<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.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">options</font></b>(<font color="#009900">Req</font>, <font color="#009900">State</font>) <font color="#990000">-&gt;</font> {<font color="#FF6600">ok</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}</tt></pre>
</div></div>
<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.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">previously_existed</font></b>(<font color="#009900">Req</font>, <font color="#009900">State</font>) <font color="#990000">-&gt;</font> {<font color="#009900">Result</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}

<font color="#009900">Result</font>  <font color="#990000">::</font> <b><font color="#000000">boolean</font></b>()
<font color="#009900">Default</font> <font color="#990000">::</font> <font color="#000080">false</font></tt></pre>
</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.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><font color="#009900">ProvideCallback</font>(<font color="#009900">Req</font>, <font color="#009900">State</font>) <font color="#990000">-&gt;</font> {<font color="#009900">Result</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}

<font color="#009900">Result</font>  <font color="#990000">::</font> <b><font color="#000000">cowboy_req:resp_body</font></b>()
<font color="#009900">Default</font>  <font color="#990000">-</font> <font color="#FF6600">crash</font></tt></pre>
</div></div>
<p>Return the response body.</p>
<p>The response body can be provided either as the actual data to be sent or a tuple indicating which file to send.</p>
<p>This function is called for both GET and HEAD requests. For the latter the body is not sent, however.</p>
<!-- @todo Perhaps we can optimize HEAD requests and just-->
<!-- allow calculating the length instead of returning the-->
<!-- whole thing.-->
<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.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">resource_exists</font></b>(<font color="#009900">Req</font>, <font color="#009900">State</font>) <font color="#990000">-&gt;</font> {<font color="#009900">Result</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}

<font color="#009900">Result</font>  <font color="#990000">::</font> <b><font color="#000000">boolean</font></b>()
<font color="#009900">Default</font> <font color="#990000">::</font> <font color="#000080">true</font></tt></pre>
</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.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">service_available</font></b>(<font color="#009900">Req</font>, <font color="#009900">State</font>) <font color="#990000">-&gt;</font> {<font color="#009900">Result</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}

<font color="#009900">Result</font>  <font color="#990000">::</font> <b><font color="#000000">boolean</font></b>()
<font color="#009900">Default</font> <font color="#990000">::</font> <font color="#000080">true</font></tt></pre>
</div></div>
<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.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">uri_too_long</font></b>(<font color="#009900">Req</font>, <font color="#009900">State</font>) <font color="#990000">-&gt;</font> {<font color="#009900">Result</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}

<font color="#009900">Result</font>  <font color="#990000">::</font> <b><font color="#000000">boolean</font></b>()
<font color="#009900">Default</font> <font color="#990000">::</font> <font color="#000080">false</font></tt></pre>
</div></div>
<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.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">valid_content_headers</font></b>(<font color="#009900">Req</font>, <font color="#009900">State</font>) <font color="#990000">-&gt;</font> {<font color="#009900">Result</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}

<font color="#009900">Result</font>  <font color="#990000">::</font> <b><font color="#000000">boolean</font></b>()
<font color="#009900">Default</font> <font color="#990000">::</font> <font color="#000080">true</font></tt></pre>
</div></div>
<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.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">valid_entity_length</font></b>(<font color="#009900">Req</font>, <font color="#009900">State</font>) <font color="#990000">-&gt;</font> {<font color="#009900">Result</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}

<font color="#009900">Result</font>  <font color="#990000">::</font> <b><font color="#000000">boolean</font></b>()
<font color="#009900">Default</font> <font color="#990000">::</font> <font color="#000080">true</font></tt></pre>
</div></div>
<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.9
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000000">variances</font></b>(<font color="#009900">Req</font>, <font color="#009900">State</font>) <font color="#990000">-&gt;</font> {<font color="#009900">Result</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}

<font color="#009900">Result</font>  <font color="#990000">::</font> [<b><font color="#000080">binary</font></b>()]  <i><font color="#9A1900">%% case insensitive</font></i>
<font color="#009900">Default</font> <font color="#990000">::</font> []</tt></pre>
</div></div>
<p>Return the list of request headers that affect the representation of the resource.</p>
<p>Cowboy automatically adds the accept, accept-charset and accept-language headers when necessary. It&apos;s also useful to note that some standard headers also do not need to be listed here, like the authorization header.</p>
<h2 id="_changelog">Changelog</h2>
<ul><li><strong>2.1</strong>: The <code>switch_handler</code> return value was added.
</li>
<li><strong>1.0</strong>: Behavior introduced.
</li>
</ul>
<h2 id="_see_also">See also</h2>
<p><a href="..">cowboy(7)</a>, <a href="../cowboy_handler">cowboy_handler(3)</a></p>






</div>

<div class="span3 sidecol">


<h3>
	Cowboy
	2.5
	Function Reference
	
</h3>

<ul>
	
		<li><a href="/docs/en/cowboy/2.5/guide">User Guide</a></li>
	
	
		<li><a href="/docs/en/cowboy/2.5/manual">Function Reference</a></li>
	
	
</ul>

<h4 id="docs-nav">Navigation</h4>

<h4>Version select</h4>
<ul>
	
	
	
		<li><a href="/docs/en/cowboy/2.8/manual">2.8</a></li>
	
		<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>
	
		<li><a href="/docs/en/cowboy/2.4/manual">2.4</a></li>
	
		<li><a href="/docs/en/cowboy/2.3/manual">2.3</a></li>
	
</ul>

<h3 id="_like_my_work__donate">Like my work? Donate!</h3>
<p>Donate to Loïc Hoguin because his work on Cowboy, Ranch, Gun and Erlang.mk is fantastic:</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" style="display:inline">
<input type="hidden" name="cmd" value="_donations">
<input type="hidden" name="business" value="[email protected]">
<input type="hidden" name="lc" value="FR">
<input type="hidden" name="item_name" value="Loic Hoguin">
<input type="hidden" name="item_number" value="99s">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donate_LG.gif:NonHosted">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/fr_FR/i/scr/pixel.gif" width="1" height="1">
</form><p>Recurring payment options are also available via <a href="https://github.com/sponsors/essen">GitHub Sponsors</a>. These funds are used to cover the recurring expenses like food, dedicated servers or domain names.</p>



</div>
</div>
</div>
</div>

      <footer>
        <div class="container">
          <div class="row">
            <div class="span6">
              <p id="scroll-top"><a href="#">↑ Scroll to top</a></p>
              <nav>
                <ul>
                  <li><a href="mailto:[email protected]" title="Contact us">Contact us</a></li><li><a href="https://github.com/ninenines/ninenines.github.io" title="Github repository">Contribute to this site</a></li>
                </ul>
              </nav>
            </div>
            <div class="span6 credits">
               <p><img src="/img/footer_logo.png"></p>
               <p>Copyright &copy; Loïc Hoguin 2012-2018</p>
            </div>
          </div>
        </div>
      </footer>

    
    <script src="/js/custom.js"></script>
  </body>
</html>