gpt4 book ai didi

python - 使用 WSGI 访问原始原始 header

转载 作者:太空宇宙 更新时间:2023-11-03 18:37:18 24 4
gpt4 key购买 nike

假设您有一个 WSGI 处理程序:

def handle_request(environ, start_response):

环境中的标题应该类似于

{'HTTP_HOST': 'localhost:8080', 'HTTP_USER_AGENT': 'Mozilla/..'}

WSGI 将“User-Agent”和“user_agent”转换为“HTTP_USER_AGENT”,但我需要确切的原始名称。

有什么方法可以访问原始 header /请求文本吗?

最佳答案

不,没有。根据 WSGI 规范, header 按照 CGI 命名规则传递。

也许实际上描述了您试图解决的根本问题。

关于python - 使用 WSGI 访问原始原始 header ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21322134/

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