[php] Test

Viewer

  1. <?php
  2.  
  3. $curl = curl_init();
  4.  
  5. curl_setopt_array($curl, array(
  6.   CURLOPT_URL => "https://ws.synchroteam.com/api/v3/activity/list?team_id=476",
  7.   CURLOPT_RETURNTRANSFER => true,
  8.   CURLOPT_ENCODING => "",
  9.   CURLOPT_MAXREDIRS => 10,
  10.   CURLOPT_TIMEOUT => 30,
  11.   CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  12.   CURLOPT_CUSTOMREQUEST => "GET",
  13.   CURLOPT_POSTFIELDS => "",
  14.   CURLOPT_HTTPHEADER => array(
  15.     "accept: text/json",
  16.     "authorization: Basic c2FybGFsdjpkM2MzNjYyYy02NDU2LTRhZDAtYTcyYi1iMmM3MTJmMTNmYzQ=",
  17.     "cache-control: no-cache",
  18.     "content-type: application/json"
  19.   ),
  20. ));
  21.  
  22. $response = curl_exec($curl);
  23. $err = curl_error($curl);
  24.  
  25. curl_close($curl);
  26.  
  27. if ($err) {
  28.   echo "cURL Error #:" . $err;
  29. } else {
  30.   echo $response;
  31. }
  32. ?>
  33.  

Editor

You can edit this paste and save as new:


File Description
  • Test
  • Paste Code
  • 23 Jun-2021
  • 771 Bytes
You can Share it: