1
我想在PHP中使用谷歌網站管理員工具API: 我已經設法在我的帳戶中創建網站的功能..但現在我試圖讓驗證工作...谷歌網站管理員工具 - API和PHP PUT
所以,問題是......在文檔說: 然後提交認證PUT請求: https://www.google.com/webmasters/tools/feeds/sites/http%3A%2F%2Fwww%2Eexample%2Ecom%2F/
但一切我都試過不工作k ...例如..
$method = strtoupper('put');
$opts = array('http' =>
array(
'method' => $method,
'protocol_version' => 1.0,
'header' => 'Content-type: application/atom+xml'."\n Authorization: GoogleLogin auth=".$auth."\n Content-Length: ".strlen($content),
'content' => $content
)
);
$context = stream_context_create($opts);
$result = file_get_contents($url, false, $context);
任何人有一些想法如何使驗證工作? :)