Using BaseHTTPServer

Lars von Wedel lvw at lfpt.rwth-aachen.de
Fri Apr 28 08:49:22 CEST 2000



Hello,

my CGI project suffers from a lengthy delay for starting up
python and loading all required modules. I'm thinking about
setting up a small HTTP server in python itself so that the
interpreter and all the required modules have to be loaded only
once.

>From the module documentation it is not clear to me, what I actually
have to do to catch the GET calls arriving at the server.

I assume that I can use BaseHTTPServer as it is. I just need
to implement a working request handler, right?

Now comes the more fuzzy part:

Since I do not want to execute external files but internal methods,
I think I could modify CGIHTTPServer by subclassing it and overriding
its do_GET() method to decode the request directly? Or would I rather
use SimpleHTTPServer, here?

Within any of the do_GET methods, how do I access data that has been
sent by the client (...&data1=val1?data2=val2?...)?

Thanks,
Lars







More information about the Python-list mailing list