$data = array(
"host" => "site.com",
"key" => "gdD8dkmdNLlxREi2LkhJjYOH2kyQbJqM3cBKT5fl",
"keyLocation" => "https://site.com/gdD8dkmdNLlxREi2LkhJjYOH2kyQbJqM3cBKT5fl.txt",
"urlList" => [
"https://site.com/1",
"https://site.com/2"
]
);
$ch = curl_init('https://yandex.com/indexnow');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json; charset=utf-8'));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data, JSON_UNESCAPED_UNICODE));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HEADER, false);
$res = curl_exec($ch);
curl_close($ch);
$res = json_encode($res, JSON_UNESCAPED_UNICODE);
print_r($res);
Array
(
[0] =>
<li>aaa</li>
<li>bbb</li>
<li>ccc</li>
)
Если это основные, то вопрос можно удалить.
Спасибо.