<?php class curl extends CI_Controller { public function __construct() { // created the construct so that the helpers, libraries, models can be loaded all through this controller parent::__construct(); $this->load->helper('url'); $this->load->library('xmlrpc'); $this->load->library('xmlrpcs'); } public function index() { //curl $mytoken = array('act'=>'GetToken', 'username'=>' ***** ', 'password'=>' ******* '); $payload = json_encode($mytoken); $ch = curl_init('http://192.168.30.99:8082/ws/live2.php'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 60); curl_setopt($ch, CURLINFO_HEADER_OUT, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $payload); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', ...