我的 .htaccess 文件中有一个 apache 代理服务器设置,其中包含以下内容
#Header always set Access-Control-Allow-Origin "*"
Header onsuccess unset Access-Control-Allow-Origin
Header always set Access-Control-Allow-Origin *
Header always set Access-Control-Max-Age "1000"
Header always set Access-Control-Allow-Headers "X-Requested-With, Content-Type, Origin, Authorization, Accept, Client-Security-Token, Accept-Encoding, x-api-token"
Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
RewriteEngine On
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $1 [R=200,L,E=HTTP_ORIGIN:%{HTTP:ORIGIN}]]
RewriteRule "^proxy/https/(.*)$" "https://$1" [P]
RewriteRule "^proxy/http/(.*)$" "http://$1" [P]
我使用 python 使用以下代码进行连接,但收到 503 错误。任何指示表示赞赏
# Sample Basic Auth Url with login values as username and password
import requests
from base64 import b64encode
import json
import csv
import pythoncom
import win32com.adsi as adsi
import types
from pyad import aduser
import logging
import datetime
import os
import requests
url = "https://proxy.testserverenv.com/proxy/https/grouper.devenv.com/grouper-ws/servicesRest/v2_3_000/groups?wsLiteObjectType=WsRestFindGroupsLiteRequest&queryFilterType=FIND_BY_STEM_NAME&stemName=app:groupergroups"
user = "user"
passwd = "Pas$worD"
#debugging print statement 2/4
print("URL set")
# Make a request to the endpoint using the correct auth values
auth_values = (user, passwd)
response = requests.get(url, auth=auth_values)
正在尝试使用将基本身份验证转换为标头身份验证