[Twisted-Python] using twisted web server as a type of REST server

Andrew Bennetts andrew-twisted at puzzling.org
Sat Nov 29 18:50:22 MST 2003


On Fri, Nov 28, 2003 at 10:59:17PM -0800, Oliver Nelson wrote:
> Reading the docs on the twisted web server I see that it automatically
> handles object publishing.  But what if I want to respond to requests that
> aren't based on a object structure?  IOW:
> 
> Client does a GET on:
> localhost/infodir/subdir/doc.txt
> 
> in this case infodir, subdir, and doc.txt would actually be info to lookup
> in a database on the fly, no object structure.  Is this possible?

Yep.  Write a custom Resource, and override getChild:
    http://twistedmatrix.com/documents/howto/using-twistedweb#auto3

-Andrew.





More information about the Twisted-Python mailing list