Simple example of BaseHTTPServer use

David Lees DavidLNoSpam at raqia.com
Thu Jun 14 17:13:20 EDT 2001


I would like to use the BaseHTTPServer class to handle a PUT  and send
back some http.  I am sending the headers back correctly I think, but no
data appears to be going back.  I am probably using the wfile instance
variable incorrectly.  Here is sample code I am working on.

def do_PUT(self):
        self.send_response(200,'<response></response>\n')
        self.send_header("Content-type", "text/html")
        self.wfile.write('junker goes\nout here\n')
        	self.end_headers()



Thanks in advance.

David Lees



More information about the Python-list mailing list