• 例子 通过API 安装KZTIMER

  • PHP 语言

      <?php
      //构建请求头
      $requestHeader = array(
      "Content-Type: application/json",
      "X-Auth-Token:这里填写您服务器Token令牌值"
      );
    
      //设置参数 MOD名称
      $postArray = array(
           "modname" => 'csgoserver_kztimer'
      );
      //设置请求地址
      $ch = curl_init('https://f.upkk.com/plugin.php?id=srcds_server_user_manager:api_v1&module=L-app-Install-Mod');
    
      curl_setopt($ch,CURLOPT_HEADER,0);
      curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);
      curl_setopt($ch,CURLOPT_HTTPHEADER, $requestHeader);
      curl_setopt($ch,CURLOPT_POSTFIELDS,$postArray);
      curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
      curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
      curl_setopt($ch, CURLOPT_CONNECTTIMEOUT , 20);
      curl_setopt($ch, CURLOPT_TIMEOUT, 20);
      $data = curl_exec($ch);
      curl_close($ch);
    
      echo $data;
作者:admin  创建时间:2020-09-04 14:46
 更新时间:2022-04-09 00:14