我正在尝试在PHP中使用Google网站站长工具API :) 我已设法在我的帐户中创建用于创建网站的功能..但现在我正在努力让Verification正常工作......
所以问题是......在文档中说: 然后将经过身份验证的PUT请求提交给: https://www.google.com/webmasters/tools/feeds/sites/http%3A%2F%2Fwww%2Eexample%2Ecom%2F/
但我尝试的一切都不起作用......例如......
$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);
任何人都有一些想法如何使验证工作? :)