0

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.

ScotchAndSoda
  • 3,811
  • 4
  • 34
  • 38
  • 2
    Please don't write new code with mod_python. It's deprecated and unsupported. – Daniel Roseman Oct 23 '12 at 09:45
  • @DanielRoseman: I thought so, but mod_python officially claims that "_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._". Is this claim incorrect? – Tadeck Oct 23 '12 at 09:53
  • 1
    Graham says: ["The mod_python project is now officially dead."](http://blog.dscpl.com.au/2010/06/modpython-project-is-now-officially.html). – Matthias Oct 23 '12 at 10:03
  • @Matthias: Yes, I am familiar with that (and I knew that for some time), but 4 months later the official mod_python said something else (see above), so at least it was not dead (or it was already agonizing at the time Graham wrote that). – Tadeck Oct 23 '12 at 11:05
  • Some Linux distributions are contemplating or have already decided to drop mod_python packages from their future version. This should be a strong indicator that it would be unwise to continue with it. The last official mod_python version does not build on latest Apache 2.2 or 2.4. So unless you are prepared to take on maintenance and development of mod_python yourself, suggest you look for WSGI based alternatives. – Graham Dumpleton Oct 24 '12 at 21:42

1 Answers1

1

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.

Community
  • 1
  • 1
Tadeck
  • 132,510
  • 28
  • 152
  • 198
  • Thanks for your answer. I know that wsgi is now standard and I have experience with, but this case I have to enbed a simple python script into a php project(due to php weakness for the precise task), so mod_python seems to fit with it. – ScotchAndSoda Oct 23 '12 at 10:12