http:如何在 Python 中获取重定向位置

get_redirect.py
response = httpx.post("https://my.domain/api/redirect")
# Get redirect location
if response.has_redirect_location:
    redirect_location = response.headers['Location']
else:
    redirect_location = None

Check out similar posts by category: Python