Вот код
function postKeys($url,$data,$headers) {
$handle=curl_init(
curl_setopt($handle, CURLOPT_URL, $url);
curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($handle, CURLOPT_POST, true);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($handle, CURLOPT_POSTFIELDS, $data);
$response=curl_exec($handle);
$code=curl_getinfo($handle, CURLINFO_HTTP_CODE);
return array("code"=>$code,"response"=>$response);
}
$result=postKeys('https://webmaster.yandex.
<?xml version="1.0" encoding="UTF-8"?> | |
<error code="INVALID_URL"><message>Host is not added to the users host list</message></error> | |