在执行用于创建资产的 php 代码时出现 HTTP 代码 301 错误:
public function request($arrData = array()){
$ch = curl_init();
$arrHeader = array(
'Authorization: Bearer '.$this->strToken,
);
echo 'Call API:'.$this->strUrl."\n";
curl_setopt($ch, CURLOPT_URL, $this->strUrl);
curl_setopt($ch, CURLOPT_HTTPHEADER, $arrHeader);
//curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
if (!empty($data)){
curl_setopt($ch, CURLOPT_POSTFIELDS, $this->generateData($arrData));
}
$data = curl_exec($ch);
The value of strUrl is: https://media.windows.net/API/Assets