将 URL 作为参数传递给应用程序引擎中的处理程序
passing URL as args to handler in apps-engine
我想创建一个通过 url 获取命令的应用程序引擎。如何从处理程序中访问 URL?
class Handler:
def get(self):
url = ? #Here I want to access the url and parse it
self.response.write(url)
def main():
application = webapp.WSGIApplication([
('/get', Handler)])
我正在这样访问请求 URL:
logging.info('URL: %s' % self.request.path_info)
我正在使用 webapp2
,这是真的,但它 应该 与 webapp
一起工作,而 path_info
实际上来自 webob
,这两个框架都基于它。
我想创建一个通过 url 获取命令的应用程序引擎。如何从处理程序中访问 URL?
class Handler:
def get(self):
url = ? #Here I want to access the url and parse it
self.response.write(url)
def main():
application = webapp.WSGIApplication([
('/get', Handler)])
我正在这样访问请求 URL:
logging.info('URL: %s' % self.request.path_info)
我正在使用 webapp2
,这是真的,但它 应该 与 webapp
一起工作,而 path_info
实际上来自 webob
,这两个框架都基于它。