<?php

$postArray = [
    "method" => "provider_list", // coba dulu
    "agent_code" => "dracin",
    "agent_token" => "c2eedd7873b95bb898a458f0c4b659a9"
];

$jsonData = json_encode($postArray);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.ngaming.xyz');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // WAJIB
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);

$res = curl_exec($ch);

if (curl_errno($ch)) {
    echo 'Curl Error: ' . curl_error($ch);
}

curl_close($ch);

$result = json_decode($res, true);

echo "<pre>";
print_r($result);