阅 读 文 章

snakelets 文档,我翻译了一部分。

[来源:网上转载 (http://www.chinaunix.net) | 作者:网友(瘦青蛙) | 时间:2007-05-27 | 浏览:人次 ]


URL参数,比如:url=snoop.sn?command&arg=name,将返回”command”(字符串不是 url-escaped)

setArg(arg)
reset the URL argument (getArg() ) to something new.
重新安排URL参数。

getWebApp()
the current WebApp object
得到当前的 WebApp对象

getRangeStr()
the unparsed string value of the HTTP 'range' header, or '' (empty string).
没有分析的HTTP ‘范围’头部字符串值,或’’(空字符串)。

getRange()
the parsed HTTP 'range' header; a tuple: (from,to)
分析HTTP’范围’头部。

getAuth()
the HTTP Authorization header value, or '' (empty string).
HTTP认证标头值,或 ‘’(空字符串)

getAllHeaders()
all HTTP headers (mimetools.Message object)
所有HTTP头部(mimetools.Message 对象)

getHeader(header)
value of specified HTTP header, or None if it isn't present
指定HTTP头部值,如果不存在为None。

getForm()
parsed form contents (a dict of {param name: value} ) The form has a utility method urlencode() that returns an url-encoded query args string like "arg=value&foo=bar" for the form's parameters.
分析标单内容,可以使用urlencode()方法返回从form中得到的参数的url编码的询问参数字符串 如 “arg=value&foo=bar”。

getParameter(param, default='')
value of a single form parameter (or the provided default value -which is an empty string if not otherwise given- if the parameter doesn't exist)
单独的参数值(或者提供的默认值)。


setParameter(param,value)
sets the new value of a form parameter (as if this value was filled in by the user). See also getContext() below!
为标单参数设定新值。见getContext()

getContext()
request context (ContextContainer object). Scope: request. unique per user and per request, destroyed after request completes
请求关系(ContextContainer 对象)。范围:请求。一个用户对应一个请求,当请求完毕立即销毁。

getSession()
the session object (snakeserver.snakelet.Session object), None if there is no sessionsession
对象(snakeserver.snakelet.Session 对象),如果没有session返回None。

deleteSession()
logout current user and deletes the session object. Also clears all cookie info on the request (not on the client!)
论坛热门帖子: [lch203] 写得蛮好的linux学习笔记(10-21)
[黑马制造] 学习java的30个目标(10-19)
[笑傲股林] 做测试半年了,有点迷茫,应该再学些什么提高自己的测试水平和测试能力呢?(10-19)
[udp8589] 大家用google的来吱一声? 用百度的~~也来报道下?(10-18)
[沂偌掳兆] 本人总结的一些认为C++比较经典的书籍,希望对大家有用(10-18)
TAG标签: 翻译 文档 使用 可以 页面 URL 如果 文件 webapp 一个

最新评论 共有1位网友发表了评论

发表评论

评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名:(注册)
密码:
验证码:
匿名发表

网站地图友情连接交流论坛网站投稿广告服务联系我们留言本站长统计
Some rights reserved: www.chmhome.com, 鄂ICP备07010232号 E-mail:chinakafei@live.com,QQ:552766
中国咖啡技术网(Chmhome):国外编程技术书籍,中文编程手册,经典编程文章,交流技术,技术软件下载,计算机论文,毕业论文.