开发者

Get the GET query in a Python CGI script (Apache, mod_cgi)

开发者 https://www.devze.com 2023-02-16 06:36 出处:网络
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 gen开发者_运维技巧erated correct

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 gen开发者_运维技巧erated 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


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

Thanks!

0

精彩评论

暂无评论...
验证码 换一张
取 消