[Tutor] CGIXMLRPCRequestHandler doesn't actually work, does it?
kent37 at tds.net
Fri Jun 24 15:35:00 CEST 2005
Ron Phillips wrote:
> Run a simple CGI server by opening a command line to the parent dir of
> cgi-bin and running
> python -c "import CGIHTTPServer; CGIHTTPServer.test()"
> Oh, dear -- I responded before I read your post, Kent. It turns out it
> was option b), after all. But I had NO idea I would need to do anything
> like the little clip above. Anything else I run under CGI, I just send
> an HTTP request and it works. I read, and read, and read, but never read
> anything about starting a CGIHTTPServer -- I'll look it up right away,
> but I can't see how I missed that. Maybe by Googling "XMLRPC", which was
> what I really wanted to do.
CGI requires a running HTTP server in front of it. The server receives the HTTP request, sees that it is a CGI request, starts a new process with the environment set according to the CGI protocol, and runs the CGI handler. Do you understand this relationship? (I mean that kindly, your response makes me suspect there is a fair amount of black magic in this for you.)
The snippet above just starts a simple CGI-capable HTTP server. It is useful for testing, not an essential part of the recipe. If you have other CGIs working you must have a working HTTP server already, such as Apache or IIS.
In your initial post you said "I have run other CGI scripts in the same directory." Were those CGIs written in Python? How did you run them?
More information about the Tutor