mod蟒蛇,得到请求对象POST参数 [英] mod python, get POST parameters from request object

查看:218
本文介绍了mod蟒蛇,得到请求对象POST参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有说明如何从mod蟒蛇自定义处理程序的要求得到POST参数的任何基本的例子。我在GET请求,在那里我得到我的论点从request.args中没有问题,但如果方法是POST,request.args中是无。这些参数隐藏在哪里?

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. Where are these arguments hidden?

感谢。

推荐答案

request.args中商店查询字符串参数,为的在文档提及。

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

如果你想获得POST变量,可以随时读取请求的主体(的 request.read() ),并对其进行解析(urlde $ C你的情况$ C)。

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).

但请记住,作为官方mod_python的网页提到:

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

mod_python的的现状

Current State of Mod_Python

目前mod_python的是不是正在积极发展。这并不意味着它是死像有些人声称。这smiply意味着,当很少需要维护它的code和项目有足够成熟。

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.

这意味着你可以用更现代的东西,比如mod_wsgi的会更好。

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

这篇关于mod蟒蛇,得到请求对象POST参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆