0

I am trying to get the query string in a CGI python script because for some reason the .FieldStorage and .getvalue functions are returning "None". The query is being generated correctly. I checked it in Wireshark and it is correctly produced.

Any ideas on how I can just get the string itself correctly?

I was trying to use os.environ('QUERY_STRING') but that didn't work either.

Josh

1 Answer 1

1

I think I figured it out. I need to use the environ variable passed to the application function by mod_wsgi.

Thanks!

Sign up to request clarification or add additional context in comments.

4 Comments

You should really use a framework rather than doing this yourself from scratch. Flask is a simple micro framework. Also read 'webpython.codepoint.net/wsgi_tutorial' which goes through use of FieldStorage with WSGI.
It was a simple script but for next time I will use Flash. Thanks for the link! It seems to be broken though?
StackOverflow left extraneous quote at end of URL. Just remove it. Ie., webpython.codepoint.net/wsgi_tutorial
Thanks Graham! I used this tutorial but both seem good: archimedeanco.com/wsgi-tutorial

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.