471,055 Members | 2,037 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,055 software developers and data experts.

SimpleHTTPServer, queries unhandled?

Hey just doing some preliminary testing with SimpleHTTPServer, and i noticed
that when i request a resource with a query string parameters that this was not
handled.

is this correct, or is there a method to set query string handling?
--
Bryan Rasmussen

Jul 18 '05 #1
2 1504
Bryan Rasmussen wrote:
Hey just doing some preliminary testing with SimpleHTTPServer, and i noticed
that when i request a resource with a query string parameters that this was not
handled.

is this correct, or is there a method to set query string handling?


Well, since SimpleHTTPServer doesn't implement CGIs, the only stuff it
can serve up is static content, which clearly can't use any query string
input anyway. You probably want CGIHTTPServer.

regards
Steve
--
Steve Holden http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/
Holden Web LLC +1 703 861 4237 +1 800 494 3119
Jul 18 '05 #2
Try this in IDLE:

import CGIHTTPServer
CGIHTTPServer.test()

This starts serving right away. You can also look at CGIHTTPServer.py
in your Python/Lib to see how test() has been implemented.

test() starts serving from the current directory (of running python).
If you create a folder called cgi-bin and put a testcgi.py, this module
executes the .py file and displays the contents in the browser :-)
Thanks,
--Kartic
PS: You can handle query strings accordingly now.

Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Joshua W. Biagio | last post: by
2 posts views Thread by Jed Parsons | last post: by
3 posts views Thread by Sanghyeon Seo | last post: by
9 posts views Thread by jbrewer | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.