我正在尝试使用 Cloud Foundry 应用程序创建容器。当我通过邮递员使用适当的正文和标题向 https://v2/service_instances/temp-container 发出请求时,响应是 201 创建的。

PUT /v2/service_instances/temp-container HTTP/1.1“201 228 22” - “”Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,与 Gecko 一样)Chrome/58.0.3029.110 Safari/537.36“”192.168.0.126:44484“”10.1.7.79:61612“x_forwarded_for:”155.56.68.219,192.168.0.126“x_forwarded_proto:”https“vcap_request_id :“2636e175-fbd5-42cb-6702-5a3bc96fb07e”response_time:0.213657225 app_id:“a1be4fad-c464-456b-8b7e-792da41ec93a”app_index:“1”x_b3_traceid:“126af56ae8190efa”x_b3_spanid:“126af56ae8190efa”x_b3_parentspanid:“ - ”

但是当我通过我的 Python 代码发出相同的请求时,我得到 401 Unauthorized。

“PUT /v2/service_instances/temp-container HTTP/1.1”401 228 177“ - ”“python-requests/2.13.0”“192.168.0.126:49746”“10.2.7.81:64368”x_forwarded_for:“155.56.68.219,192.168.0.126”x_forwarded_proto:“https”vcap_request_id:“85e50f55-4852-4150-7b62-c6d7ccb41e8d”response_time:0.025489445 app_id:“a1be4fad-c464-456b-8b7e-792da41ec93a”app_index:“2”x_b3_traceid: “5beaa4c44c4b9b4f”x_b3_spanid:“5beaa4c44c4b9b4f”x_b3_parentspanid:“ - ”

我得到的信息是

访问此资源需要完全身份验证

我确信我使用相同的参数并在两种情况下发送相同的请求。可能的原因是什么?