使用 Tipfy 获取 HTTP GET 变量
我目前正在 Google 的 Appengine 上使用 tipfy,最近遇到了一个问题:我一生都找不到任何有关如何在应用程序中使用 GET 变量的文档,我尝试过筛选 tipfy 和 Werkzeug 的 文档没有成功。我知道我可以使用 request.form.get('variable')
来获取 POST 变量,并在 URL 变量的处理程序中使用 **kwargs
,但这与文档会告诉我。有什么想法吗?
I'm currently playing around with tipfy on Google's Appengine and just recently ran into a problem: I can't for the life of me find any documentation on how to use GET variables in my application, I've tried sifting through both tipfy and Werkzeug's documentations with no success. I know that I can use request.form.get('variable')
to get POST variables and **kwargs
in my handlers for URL variables, but that's as much as the documentation will tell me. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
request.args.get('variable')
应该适用于我认为您所说的“获取数据”的意思。request.args.get('variable')
should work for what I think you mean by "GET data".来源:http://www.tipfy.org/wiki/guide/request/
Request 对象包含应用程序客户端传输的所有信息。您将从中检索 GET 和 POST 值、上传的文件、cookie 和标头信息等。所有这些事情都很常见,你会很习惯的。
要访问 Request 对象,只需从 Tipfy 导入 request 变量即可:
Source: http://www.tipfy.org/wiki/guide/request/
The Request object contains all the information transmitted by the client of the application. You will retrieve from it GET and POST values, uploaded files, cookies and header information and more. All these things are so common that you will be very used to it.
To access the Request object, simply import the request variable from tipfy:
这对我有用(tipfy 0.6):
this works for me (tipfy 0.6):