how to implement render_POST?
Dos anyone have and example how to implement the different render function in web. Im trying to implement a REST service and I now have to use the render_POST. My render_POST function looks like this: def render_POST(self,request): print request.received_headers print request.content.readlines() print request return "<html></html>" but the only output i see is: {'content-length': '134', 'content-type': 'application/x-www-form- urlencoded', 'host': 'sbcmac.local:8081', 'user-agent': 'Python- urllib/1.16'} [] <POST /User HTTP/1.0> I wonder why I cant see the data I am posting. Can any of you guys see what im doing wrong??? ps. if anyone have a link to some example code, showing how to implement render_POST, render_PUT and render_DELETE I would be very happy ##### Client POST test code import urllib import sys url = "http://sbcmac.local:8081/User" param={'xml': """<userlist><user ContactName="Soren Bach Christinansen" ID="1" UserName="sbc"/></userlist>"""} if __name__ == '__main__': try: doc=urllib.urlencode(param) remote = urllib.urlopen(url,doc) except: sys.exit() /Søren
Thanks, dont know how I missed that one. /Søren On Jul 23, 2007, at 18:49 , Maarten ter Huurne wrote:
On Monday 23 July 2007, Søren Bach Christiansen wrote:
I wonder why I cant see the data I am posting. Can any of you guys see what im doing wrong???
You can access the data through "request.args", just like it works for GET requests.
Bye, Maarten _______________________________________________ Twisted-web mailing list Twisted-web@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
participants (2)
-
Maarten ter Huurne
-
Søren Bach Christiansen