• 21-04-2023, 09:10:51
    #1
    Merhaba Bing webmastertool da İndexnow veya SubmitUrl Api desteği sağlamak istiyorum fakat api dokümanındaki post alanı kafamı karıştırdı rica etsem bunun php api dökümanını paylaşabilir mi? Teşekkür ederim
    https://www.bing.com/webmasters/url-submission-api#APIs
    https://wordpress.org/plugins/indexnow/
  • 21-04-2023, 19:06:17
    #2
    json post edeceksiniz.
    curl postfields query string yerine json olacak ve header olarak da content-type: application/json gönderilmesi gerekiyor.

    $data = [
        'siteUrl' => 'https://siteadresi.com',
        'urlList' => [
            'https://siteadresi.com/sayfa1',
            'https://siteadresi.com/sayfa2',
        ],
    ];
    
    
    $ch_options = [
        CURLOPT_URL => $api_url,
        CURLOPT_POST => true,
        CURLOPT_HEADER => false,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_POSTFIELDS => json_encode($data),
        CURLOPT_HTTPHEADER => 'Content-Type: application/json',
    ];
    
    $ch = curl_init();
    curl_setopt_array($ch, $ch_options);
    
    $response = curl_exec($ch);
  • 21-04-2023, 20:42:27
    #3
    trgino adlı üyeden alıntı: mesajı görüntüle
    json post edeceksiniz.
    curl postfields query string yerine json olacak ve header olarak da content-type: application/json gönderilmesi gerekiyor.

    $data = [
        'siteUrl' => 'https://siteadresi.com',
        'urlList' => [
            'https://siteadresi.com/sayfa1',
            'https://siteadresi.com/sayfa2',
        ],
    ];
    
    
    $ch_options = [
        CURLOPT_URL => $api_url,
        CURLOPT_POST => true,
        CURLOPT_HEADER => false,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_POSTFIELDS => json_encode($data),
        CURLOPT_HTTPHEADER => 'Content-Type: application/json',
    ];
    
    $ch = curl_init();
    curl_setopt_array($ch, $ch_options);
    
    $response = curl_exec($ch);
    Çok teşekkürler hocam sayenizde çözdüm
  • 25-09-2024, 15:39:53
    #4
    trgino adlı üyeden alıntı: mesajı görüntüle
    json post edeceksiniz.
    curl postfields query string yerine json olacak ve header olarak da content-type: application/json gönderilmesi gerekiyor.

    $data = [
        'siteUrl' => 'https://siteadresi.com',
        'urlList' => [
            'https://siteadresi.com/sayfa1',
            'https://siteadresi.com/sayfa2',
        ],
    ];
    
    
    $ch_options = [
        CURLOPT_URL => $api_url,
        CURLOPT_POST => true,
        CURLOPT_HEADER => false,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_POSTFIELDS => json_encode($data),
        CURLOPT_HTTPHEADER => 'Content-Type: application/json',
    ];
    
    $ch = curl_init();
    curl_setopt_array($ch, $ch_options);
    
    $response = curl_exec($ch);
    Merhabalar, yukarıdaki kodları yazdığımız dosyayı public_html ya da httpdocs içerisine mi atmamız gerekiyor?