I think you should consider using the
WSGI interface.

The WSGI interface puts all the components of a request
into a request environment dictionary which is sent as a
parameter to the function generating the response.  
For example have a look at the test application

http://whiffdoc.appspot.com/tests/misc/testDebugDump?thisVar=thatValue&thisOtherVar=ThatOtherValue

which dumps out the WSGI environment (with WHIFF extensions)
to the response.  All the information you need is somewhere inside
the environment dictionary (but it's not always easy to find).

You could also look at WHIFF which helps combine some of the
features of the CGI module with the WSGI interface.

http://whiffdoc.appspot.com/

Hope that helps,  -- Aaron Watters

===
% man less
less is more.


--- On Sat, 4/3/10, J.D. Main <jdm...@comcast.net> wrote:

> From: J.D. Main <jdm...@comcast.net>
> Subject: [Web-SIG] IIS and Python CGI - how do I see more than just the form 
> data?
> To: web-sig@python.org
> Date: Saturday, April 3, 2010, 12:32 PM
> Hi Folks,
> 
> I hope this question hasn't already been answered...
> 
> I'm using IIS 5 and calling a python script directly in the
> URL of a request.  
> Something like:
> 
> http://someserver/myscript.py
> 
> or even
> 
> http://someserver/myscript.py?var1=something&var2=somthingelse
> 
> Using the CGI module, I can certainly see and act upon the
> variables that 
> are passed as  GET or POST actions.  What I'm
> after is something more 
> low level.  I want to see the entire HTTP request with
> everything inside it.
> 
> Does IIS actually pass that information to the CGI
> application or does it just 
> pass the variables?
> 
> The intent is to write a "RESTFUL" CGI script.  I need
> to actually "see" the 
> URI and the parameters of the incoming request to map the
> appropriate 
> action.  Without short circuiting the IIS webserver,
> how would my python 
> parse the following:
> 
> http://someserver/someapp/someuser/someupdate?var1=Charlie
> 
> Thanks in advance!
> 
> JDM
> 
> 
> _______________________________________________
> Web-SIG mailing list
> Web-SIG@python.org
> Web SIG: http://www.python.org/sigs/web-sig
> Unsubscribe: 
> http://mail.python.org/mailman/options/web-sig/arw1961%40yahoo.com
> 
_______________________________________________
Web-SIG mailing list
Web-SIG@python.org
Web SIG: http://www.python.org/sigs/web-sig
Unsubscribe: 
http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com

Reply via email to