SimpleHTTPServer, queries unhandled?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bryan Rasmussen

    #1

    SimpleHTTPServer, queries unhandled?

    Hey just doing some preliminary testing with SimpleHTTPServe r, 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





  • Steve Holden

    #2
    Re: SimpleHTTPServe r, queries unhandled?

    Bryan Rasmussen wrote:
    [color=blue]
    > Hey just doing some preliminary testing with SimpleHTTPServe r, 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?[/color]

    Well, since SimpleHTTPServe r 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

    Comment

    • Kartic

      #3
      Re: SimpleHTTPServe r, queries unhandled?

      Try this in IDLE:

      import CGIHTTPServer
      CGIHTTPServer.t est()

      This starts serving right away. You can also look at CGIHTTPServer.p y
      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.

      Comment

      Working...