<?php

class API_Config{

   public $base_URL;

   

  function __construct() {

      $this->base_URL = "http://localhost/MyBooster/API/";

   }

   
   public function call_API($apiName, $params){

		$url = $this->base_URL . $apiName;
		$request =json_encode($params);
		$ch = curl_init();
		curl_setopt( $ch, CURLOPT_URL, $url);
		curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
		curl_setopt( $ch, CURLOPT_VERBOSE, true );
		curl_setopt( $ch, CURLOPT_ENCODING, '' );
		curl_setopt( $ch, CURLOPT_CUSTOMREQUEST,'POST');
		curl_setopt( $ch, CURLOPT_POSTFIELDS, $request);
		curl_setopt( $ch, CURLOPT_HTTPHEADER, array(
		   'Content-Type: application/json'
		) );

		$response = curl_exec($ch);
		curl_close($ch);

		return $response;

   }


}









?>