且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用 REST API 身份验证错误使用 PHP 连接到 VCenter

更新时间:2022-05-29 21:28:20

我也遇到了同样的问题,最终明白是这个header引起的:

I had the same problem, and eventually understood that it is caused by this header:

curl_setopt($ch, CURLOPT_POST, true);

用这个替换它可以解决问题:

And replacing it with this one solves the issue:

curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');