下面的代码接受一个输入参数t
,并返回相同的值。你知道吗
import web
urls = (
'/test(.*)', 'test',
)
class test(web.storage):
def GET(self,r):
t = web.input().q
print t
return t
if __name__ == "__main__":
app = web.application(urls, globals())
app.run()
所以当我在浏览器中执行下面的URL时,这是正确的
http://localhost:8080/test?q=word1-word2
但是当有一个+符号时,它就消除了这个。你知道吗
http://localhost:8080/test?q=word1+word2
返回
word1 word2
预期结果是什么
word1+word2
我怎样才能防止这种情况?你知道吗
尝试对查询字符串进行URL编码:
因为
+
用于替换空格。你知道吗相关问题 更多 >
编程相关推荐