fork download
  1. <?php
  2. function callAPI($method, $url, $data, $headers = false){
  3. $curl = curl_init();
  4. switch ($method){
  5. }
  6. // OPTIONS:
  7. curl_setopt($curl, CURLOPT_URL, $url);
  8. if(!$headers){
  9. curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  10. 'APIKEY: 111111111111111111111',
  11. 'Content-Type: application/json',
  12. ));
  13. }else{
  14. curl_setopt($curl, CURLOPT_HTTPHEADER, array(
  15. 'APIKEY: 111111111111111111111',
  16. 'Content-Type: application/json',
  17. $headers
  18. ));
  19. }
  20. curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  21. curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
  22. }
  23. ?>
  24.  
Success #stdin #stdout 0.02s 25664KB
stdin
DDDDDDDDDDDDDDDD
stdout
Standard output is empty