Results 1 to 3 of 3

Thread: curl: Server Response null

  1. #1

    curl: Server Response null

    Hello,

    My script was working and able to get responses correctly, but recently it was no longer working as it used to. I am getting a Null(empty string) response instead of errors... ideas?

    header('Content-Type: text/html; charset=UTF-8');
    $clantag = "#<clantag>";
    $token = "<token>";

    $url = "https://api.clashofclans.com/v1/clans/" . urlencode($clantag);
    $ch = curl_init($url);
    $headr = array();
    $headr[] = "Accept: application/json";
    $headr[] = "Authorization: Bearer ". $token;
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headr);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $jsonData = curl_exec($ch);
    $phpData = json_decode($jsonData, true);
    curl_close($ch);



    echo var_dump($jsonData);
    echo var_dump($phpData);

  2. #2
    the servers were down for a bit. Is it still happening?
    Wheel of Time. Check us out at www.discord.me/wotcoc for more information.

  3. #3
    No it is still giving me a null string. Would there be another thought?

    Should I try remaking a new token key?
    Last edited by AcidSnake; February 3rd, 2017 at 03:19 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •