gpt4 book ai didi

Python urllib Request 对象 - 在 GAE 上找出请求是 https 还是 http

转载 作者:行者123 更新时间:2023-11-28 21:26:45 25 4
gpt4 key购买 nike

Request 对象有 url 属性,我可以做一个

request.url.startswith('https:')

request.url.startswith('http:')

查看请求是否是 https,但我想知道是否有更简洁/优雅的方法来执行此操作。

我在 Google App Engine 上执行此操作。

最佳答案

如果您使用的是 webapp2,则可以使用 request.scheme。

关于Python urllib Request 对象 - 在 GAE 上找出请求是 https 还是 http,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12229946/

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