. * * * The author of this software is Mashape, Inc. * For any question or feedback please contact us at: support@mashape.com * */ require_once(dirname(__FILE__) . "/../init/init.php"); require_once(dirname(__FILE__) . "/../exceptions/mashapeClientException.php"); define("METHOD", "_method"); define("TOKEN", "_token"); define("LANGUAGE", "_language"); define("VERSION", "_version"); class HttpMethod { const DELETE = 0; const GET = 1; const POST = 2; const PUT = 3; } class HttpClient { public static function call($baseUrl, $httpMethod, $method, $token, $parameters) { if (empty($parameters)) { $parameters = array(); } else { // Remove null parameters $keys = array_keys($parameters); for ($i = 0;$i array( 'ignore_errors' => true, 'method' => $httpMethod, 'content' => $data ) ); $context = stream_context_create($opts); $response = @file_get_contents($url, false, $context); return $response; } } ?>