mod python, get POST parameters from request objec

2019-09-07 10:57发布

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.

1条回答
ら.Afraid
2楼-- · 2019-09-07 11:26

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.

查看更多
登录 后发表回答