473,653 Members | 3,000 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Jul 18 '05 #1
2 1595
Bryan Rasmussen wrote:
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?


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
Jul 18 '05 #2
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.

Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2003
by: Joshua W. Biagio | last post by:
Hello all, I am having difficulty getting the HTTP/1.1 support (i.e. pipelining and persistent connections) for the BaseHTTPServer library to work. When I change the line for the protocol in BaseHTTPServer from "HTTP/1.0" to "HTTP/1.1", the SimpleHTTPServer program can still serve directory listings and even graphics files, but it hangs when I try to browse to an HTML file. I have a directory of web pages that I use to test servers (such as...
2
3127
by: Jed Parsons | last post by:
Hola - I'm curious about using SimpleHTTPServer as the web server on my home machine. It would pretty much just be hit by me, search robots, and automated attacks :) So, before I ditch apache for the fun, all-python setup, are there any security concerns about using SimpleHTTPServer? Thanks for any advice/info,
3
2509
by: Sanghyeon Seo | last post by:
I took some time to write this HOWTO: http://sparcs.kaist.ac.kr/~tinuviel/fepy/howto/simplehttpserver-ironpython-mono-howto.html IronPython seems to get much less interest than it deserves. This howto shows how to setup IronPython to use with Mono on Linux and how to rebuild IronPython from source. It also discusses various patches to current problems. It also shows that IronPython can run SimpleHTTPServer today, not a trivial...
1
3413
by: Ben | last post by:
Hi there, Perhaps someone can help me. For some reason, when my Python script runs and loads an HTML page in a new browser window at the local host (desktop), the links to my stylesheet and all the images are broken. I did check the HTML file by itself...everything loaded fine ;) Here's my script: -------------------- # File: webbrowser-test.py
9
2972
by: jbrewer | last post by:
I'm currently implementing an XML-RPC service in Python where binary data is sent to the server via URLs. However, some clients that need to access the server may not have access to a web server, and I need to find a solution. I came up with the idea of embedding a simple HTTP server in the XML-RPC clients so that files can be sent in the following way: 1. Start an HTTP server on the client using e.g SImpleHTTPServer on a user...
0
771
by: Leo Jay | last post by:
http://bugs.python.org/issue1097597 in my python 2.5.2, i still find these code in SimpleHTTPServer.py, is that deliberate? ctype = self.guess_type(path) if ctype.startswith('text/'): mode = 'r' else: mode = 'rb' try:
0
773
by: Gabriel Genellina | last post by:
En Fri, 13 Jun 2008 04:02:48 -0300, Leo Jay <python.leojay@gmail.com> escribió: According to http://bugs.python.org/issue839496 it should have been corrected, but apparently the patch was only applied to the 2.4 maintenance branch, not to the trunk. Both 2.5 and 2.6 have the same problem. 3.0 doesn't have this problem but probably it was fixed independently.
1
960
by: Terry Reedy | last post by:
"Gabriel Genellina" <gagsl-py2@yahoo.com.arwrote in message news:op.ucokc3o6x6zn5v@gabriel2.softlabbsas.com.ar... En Fri, 13 Jun 2008 04:02:48 -0300, Leo Jay <python.leojay@gmail.com> escribió: According to http://bugs.python.org/issue839496 it should have been corrected, but apparently the patch was only applied to the 2.4 maintenance branch, not to the trunk. Both 2.5 and 2.6 have the same problem. 3.0 doesn't have this problem but...
4
5835
by: sebsauvage | last post by:
Hello. I'm using SimpleHTTPServer (work well) but it always sends "Server" header in response: "Server: SimpleHTTP/0.6 Python/2.5.1" How can I remove that ? I tried:
0
8370
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8283
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8811
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8704
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8590
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5620
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4291
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2707
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1591
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.