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.

5
  • 2
    Please don't write new code with mod_python. It's deprecated and unsupported. Commented Oct 23, 2012 at 9: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? Commented Oct 23, 2012 at 9:53
  • 1
    Graham says: "The mod_python project is now officially dead.". Commented Oct 23, 2012 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). Commented Oct 23, 2012 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. Commented Oct 24, 2012 at 21:42

1 Answer 1

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.

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

1 Comment

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.

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.