【问题标题】:How do i get the HTTP headers in a Google App Engine webapp2 requesthandler如何在 Google App Engine webapp2 requesthandler 中获取 HTTP 标头
【发布时间】:2013-05-14 06:42:49
【问题描述】:

如何访问调用此方法的请求的 http 标头?

class GetDBVersion(webapp2.RequestHandler):
    def get(self):
# writes out db version

在 main.py 中

app = webapp2.WSGIApplication([
    ('/version', GetDBVersion
      # and more methods

【问题讨论】:

    标签: python google-app-engine http-headers


    【解决方案1】:

    使用 webapp2.RequestHandler 在类中执行此操作。

    self.request.headers

    它会给你一个标题的字典。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-08-11
      • 2014-04-27
      • 1970-01-01
      • 2011-10-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多