Call a REST API in PHP
You can access any REST API with PHPs cURL Extension. However, the API Documentation (Methods, Parameters etc.) must be provided by your Client! Example: // Method: POST, PUT, GET etc // Data: array(“param” => “value”) ==> index.php?param=value function CallAPI($method, $url, $data = false) { $curl = curl_init(); switch ($method) { case “POST”: curl_setopt($curl, CURLOPT_POST, 1); … Read more