Hey guys -
I'd like to manually handle a POST like I can in an HTTPBaseServer
subclass (which I can't use b/c it is single-threaded). This should
be easy but I'm not really comprehending the whole hooks system. Is
there a simple way to do the equivalent of the following? Thanks -
def do_POST(self):
#<<< double-check this
self.query_string = self.rfile.read( int(self.headers
['Content-Length']))
self.args = dict(cgi.parse_qsl(self.query_string))
msg = self.args['body']
f = open('log.txt','a')
f.write(msg + '\n')
f.close()
self.send_response(200)
self.send_header('Content-type', 'text/plain')
self.send_header('Content-length', len(msg) )
self.end_headers()
self.wfile.write(msg)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To post to this group, send email to
cherrypy-users@...
To unsubscribe from this group, send email to
cherrypy-users+unsubscribe@...
For more options, visit this group at
http://groups.google.com/group/cherrypy-users?hl=en-~----------~----~----~----~------~----~------~--~---