【问题标题】:passing URL as args to handler in apps-engine将 URL 作为 args 传递给应用程序引擎中的处理程序
【发布时间】:2018-11-10 11:06:26
【问题描述】:

我想创建一个通过 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)])

【问题讨论】:

    标签: python http google-app-engine url url-parameters


    【解决方案1】:

    我正在访问这样的请求 URL:

    logging.info('URL: %s' % self.request.path_info)
    

    我正在使用 webapp2,这是真的,但它应该webapp 以及 path_info 实际上来自 webob,这两个框架都基于。 p>

    【讨论】:

      猜你喜欢
      • 2015-09-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-15
      相关资源
      最近更新 更多