Initial import to Tizen
[profile/ivi/python-twisted.git] / doc / web / howto / glossary.html
1 <?xml version="1.0" encoding="utf-8"?><!DOCTYPE html  PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN'  'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html lang="en" xmlns="http://www.w3.org/1999/xhtml">
2   <head>
3 <title>Twisted Documentation: Glossary</title>
4 <link href="stylesheet.css" rel="stylesheet" type="text/css"/>
5   </head>
6
7   <body bgcolor="white">
8     <h1 class="title">Glossary</h1>
9     <div class="toc"><ol/></div>
10     <div class="content">
11     <span/>
12
13     <p class="note"><strong>Note: </strong>This glossary is very incomplete.  Contributions are
14     welcome.</p>
15
16     <dl>
17       <dt><a name="resource" shape="rect">resource</a></dt>
18       <dd>
19         An object accessible via HTTP at one or more URIs.  In Twisted Web,
20         a resource is represented by an object which provides <code class="API"><a href="http://twistedmatrix.com/documents/12.1.0/api/twisted.web.resource.IResource.html" title="twisted.web.resource.IResource">twisted.web.resource.IResource</a></code> and most often is
21         a subclass of <code class="API"><a href="http://twistedmatrix.com/documents/12.1.0/api/twisted.web.resource.Resource.html" title="twisted.web.resource.Resource">twisted.web.resource.Resource</a></code>.  For example, here
22         is a resource which represents a simple HTML greeting.
23
24 <pre class="python"><p class="py-linenumber">1
25 2
26 3
27 4
28 5
29 </p><span class="py-src-keyword">from</span> <span class="py-src-variable">twisted</span>.<span class="py-src-variable">web</span>.<span class="py-src-variable">resource</span> <span class="py-src-keyword">import</span> <span class="py-src-variable">Resource</span>
30
31 <span class="py-src-keyword">class</span> <span class="py-src-identifier">Greeting</span>(<span class="py-src-parameter">Resource</span>):
32     <span class="py-src-keyword">def</span> <span class="py-src-identifier">render_GET</span>(<span class="py-src-parameter">self</span>, <span class="py-src-parameter">request</span>):
33         <span class="py-src-keyword">return</span> <span class="py-src-string">&quot;Hello, world.&quot;</span>
34 </pre>
35       </dd>
36     </dl>
37   </div>
38
39     <p><a href="index.html">Index</a></p>
40     <span class="version">Version: 12.1.0</span>
41   </body>
42 </html>