gpt4 book ai didi

python - 我如何在 Google App Engine webapp2 请求处理程序中获取 HTTP header

转载 作者:太空宇宙 更新时间:2023-11-03 13:47:33 25 4
gpt4 key购买 nike

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

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

在 main.py 中

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

最佳答案

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

self.request.headers

它会给你一个标题字典。

关于python - 我如何在 Google App Engine webapp2 请求处理程序中获取 HTTP header ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16536690/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com