Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/365.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法将url参数传递到GAE python中的类方法中_Python_Google App Engine_Python 2.7 - Fatal编程技术网

无法将url参数传递到GAE python中的类方法中

无法将url参数传递到GAE python中的类方法中,python,google-app-engine,python-2.7,Python,Google App Engine,Python 2.7,我试图将一些参数从URL传递到我的google app engine Python apps类方法,但我没有打印这些参数。 下面是python代码 class CheckResponse(webapp.RequestHandler): def get(self, resp): self.response.headers['Content-Type'] = 'text/plain' self.response.write(resp) applic

我试图将一些参数从URL传递到我的google app engine Python apps类方法,但我没有打印这些参数。 下面是python代码

    class CheckResponse(webapp.RequestHandler):
    def get(self, resp):
        self.response.headers['Content-Type'] = 'text/plain'
        self.response.write(resp)


application = webapp2.WSGIApplication([
    ('/mail', MainPage),
    ('/', ShowHome),
    ('/checkResponse?(.*)', CheckResponse)
], debug=True)
下面是URL
www.example.com/checkResponse?Id=10&Res=Yes
1) 为什么resp没有打印出来。
2) 我还想知道是否有办法直接打印传入参数的值,而无需解析响应url。

查看此文档以获取请求数据,如您的ID和Res:


已经做了,dat是我如何得到上述代码的…如果你能特别指出一些事情,那将是很有帮助的
class CheckResponse(webapp2.RequestHandler):   # webapp2

    def get(self):

        self.response.headers['Content-Type'] = 'text/plain'
        self.response.write(self.request.GET['resp'])

application = webapp2.WSGIApplication([
        ('/mail', MainPage),
        ('/', ShowHome),
        ('/checkResponse', CheckResponse)      # changed
    ], debug=True)