Question

Is there any basic example that shows how to get POST parameters from the request in mod python custom handler. I have no trouble in GET requests, where I get my arguments from request.args, BUT if method is POST, request.args is None.

Thanks.

Was it helpful?

Solution

request.args stores query string parameters, as mentioned in the documentation.

If you want to get POST variables, you can always read the body of the request (request.read()) and parse it (urldecode in your case).

But keep in mind that, as mentioned on the official mod_python homepage:

Current State of Mod_Python

Currently mod_python is not under active development. This does not mean that it is "dead" as some people have claimed. It smiply means that the code and the project are mature enough when very little is required to maintain it.

Which means you may be better off using something more modern, like mod_wsgi.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top