RE: [Twisted-web] Documentation for Twisted.Web
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? ;-) Harald PS 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@gmail.com] Sent: lördag, 23 oktober 2004 10:50 To: twisted-web@twistedmatrix.com Subject: [Twisted-web] Documentation for Twisted.Web Hi, 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 ... Seun _______________________________________________ Twisted-web mailing list Twisted-web@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
participants (1)
-
Harald.Nyman@astrazeneca.com