Here's some sample code to get you started:<br><br> def render_PUT(self,request):<br> print "Got PUT"<br>
dataPage=request.content.getvalue()<br> pageNumber=request.args.get("pagenumber",(0,))[0]<br> (responseCode,message) = self._savePage(request.args["keynumber"][0], self.userId,pageNumber,dataPage)
<br> request.setResponseCode(responseCode)<br> return message <br><br>notice how you get at the PUT data via request.content.getvalue() I remember needing a while to find that. render_PUT can be added to twisted.web.resource.Resource
or a subclass as Jarek says.<br><br>-Andy Fundinger<br><br><div><span class="gmail_quote">On 10/12/07, <b class="gmail_sendername">Jarek Zgoda</b> <<a href="mailto:jarek.zgoda@sensisoft.com">jarek.zgoda@sensisoft.com</a>
> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Voznesensky Vladimir napisał(a):<br><br>> I need to realise an HTTP server capable of serving PUT request.
<br>> There seems to be no standard twisted implementation for it.<br>> Is it possible to realise and include it into the standard twisted<br>> contribution?<br>> I have no solid idea were to start with it.<br>
<br>Start at twisted.web<br><br>Just write a resource class (subclass of twisted.web.resource.Resource)<br>that handles PUT requests by implementing render_PUT method.<br><br>--<br>Jarek Zgoda<br>Skype: jzgoda | GTalk: <a href="mailto:zgoda@jabber.aster.pl">
zgoda@jabber.aster.pl</a> | voice: +48228430101<br><br>"We read Knuth so you don't have to." (Tim Peters)<br><br>_______________________________________________<br>Twisted-Python mailing list<br><a href="mailto:Twisted-Python@twistedmatrix.com">
Twisted-Python@twistedmatrix.com</a><br><a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br></blockquote></div><br><br clear="all">
<br>-- <br>Blog: <a href="http://channel3b.wordpress.com">http://channel3b.wordpress.com</a><br>Second Life Name: Ciemaar Flintoff<br><br>I am a sig Virus. Please put me in your sig so that I can continue to replicate.