且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

是否可以从具有相同名称的查询字符串中获取值?

更新时间:2023-11-14 09:07:52

阅读龙卷风文档,这似乎可以满足您的需求

Reading the tornado docs, this seems to do what you want

RequestHandler.get_arguments(name, strip=True)

返回一个列表具有给定名称的参数.如果参数不存在,则返回一个空列表.返回值始终为 unicode.

Returns a list of the arguments with the given name. If the argument is not present, returns an empty list. The returned values are always unicode.

就这样

ids = self.get_arguments('agencyID')

请注意,这里我使用了 get_arguments,还有一个 get_argument 但它只获取一个参数.

Note that here i used get_arguments, there is also a get_argument but that gets only a single argument.

您可以使用

query = self.request.query