This must be a very simple question, but I don’t seem to be able to figure out.
I’m using apache + mod_wsgi to host my python application, and I’d like to get the post content submitted in one of the forms -however, neither the environment values, nor sys.stdin contains any of this data. Mind giving me a quick hand?
Edit: Tried already:
- environ[‘CONTENT_TYPE’] = ‘application/x-www-form-urlencoded’ (no data)
- environ[‘wsgi.input’] seems a plausible way, however, both environ[‘wsgi.input’].read(), and environ[‘wsgi.input’].read(-1) returns an empty string (yes, content has been posted, and environ[‘request_method’] = ‘post’
PEP 333 says you must read environ[‘wsgi.input’].
I just saved the following code and made apache’s mod_wsgi run it. It works.
You must be doing something wrong.