[Twisted-web] REST and DELETE

Gary Jefferson garyjefferson123 at yahoo.com
Wed Dec 19 18:18:41 EST 2007


--- Jean-Paul Calderone <exarkun at divmod.com> wrote:

> On Wed, 19 Dec 2007 12:55:18 -0800 (PST), Gary
>
> >I haven't looked at figuring out httpclient support
> >for the same in twisted yet, but I'm assuming that
> >sending DELETE/PUT is similar to sending POST,
> i.e.,
> >use putrequest() with 'DELETE'?
> 
> I'm not sure what putrequest is.  I also don't
> really know
> what the contents of a DELETE request might be, so I
> probably
> couldn't say anything useful here even if I did know
> what
> putrequest is.


As it turns out, it's as easy as doing something like:

d = getPage(sys.argv[1], method="DELETE")
d.addCallbacks(callback=lambda
value:(println(value),reactor.stop()),
        errback=lambda error:(println("an error
occurred", error),
            reactor.stop()))

Very nice!

Gary


      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping



More information about the Twisted-web mailing list