[Twisted-web] Documentation for Twisted.Web

Harald.Nyman at astrazeneca.com Harald.Nyman at astrazeneca.com
Sat Oct 23 03:49:00 MDT 2004

I agree.

The info is there (see PS), but it took quite some time before it made any
sense to me, and I still don't understand most of the "Using twisted.web"
section, being probably unusually stupid.

Here's a humble suggestion: Add something like these 2 points -

1) Refer to Jason Hunter's "Java Servlet Programming"     # bcos that's
pretty similar (I think)

2) Try this code snippet:
    class Servlet(resource.Resource):
        def render_GET(self, request):
            print request.__dict__           # .. and see what it contains

Using that approach I've just managed to put together the coolest
asynchronous, message-driven, "don't-hang-around-waiting-for-it" web GUI
we've ever had.

The more I fumble with Twisted, the more I appreciate it.

Or did I get it all wrong again? ;-)

The Resource class, which is usually what one's Resource classes subclass,
has a convenient default implementation of render. It will call a method
named self.render_METHOD where "METHOD" is whatever HTTP method was used to
request this resource. Examples: request_GET, request_POST, request_HEAD,
and so on. It is recommended that you have your resource classes subclass
Resource and implement render_METHOD methods as opposed to render itself.
Note that for certain resources, request_POST = request_GET may be desirable
in case one wants to process arguments passed to the resource regardless of
whether they used GET (?foo=bar&baz=quux, and so forth) or POST.

-----Original Message-----
From: Seun Osewa [mailto:naijasms at gmail.com]
Sent: lördag, 23 oktober 2004 10:50
To: twisted-web at twistedmatrix.com
Subject: [Twisted-web] Documentation for Twisted.Web


I sure wish documentation for Twisted and Twisted.Web was more
complete!  Right now I feel the information about using Twisted.Wed
objects for managing http connections asynchronously _without_ the
configuration system (Tap files etc.) is incomplete.  How can one get
the required info?  It appears things are changing really fast ...


Twisted-web mailing list
Twisted-web at twistedmatrix.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 3616 bytes
Desc: not available
Url : http://twistedmatrix.com/pipermail/twisted-web/attachments/20041023/f778041a/attachment-0001.bin

More information about the Twisted-web mailing list