merhaba kullandığım betik budur
$s = $_GET['u'];
require_once 'google-api-php-client/vendor/autoload.php';
$client = new Google_Client();
// service_account_file.json is the private key that you created for your service account.
$client->setAuthConfig('localindexingapi-8c.json');
$client->addScope('https://www.googleapis.com/auth/indexing');
// Get a Guzzle HTTP Client
$httpClient = $client->authorize();
$endpoint = 'https://indexing.googleapis.com/v3/urlNotifications:publish';
// Define contents here. The structure of the content is described in the next step.
$content = '{
"url": "$s",
"type": "URL_UPDATED"
}';
$response = $httpClient->post($endpoint, [ 'body' => $content ]);
$status_code = $response->getStatusCode();
//print_r($response);
echo "\n";
echo "$status_code"; "url": "$s",
kısmını
"url": "http://site.domain",
yaptığımda sıkıntısız çalışıyor
get yada post ile veri gönderidiğimde hiç bir şekilde çalıştıramadım nerede hata yapıyorum acaba :S