I am new for codeigniter and I am using Phil Sturgeon’s REST server for "post" type of web service. althiugh my 'get' type web service is working perfectly. Below is my controller code for post web service.
require(APPPATH.'libraries/REST_Controller.php');
class json extends REST_Controller {
public function __construct() {
parent::__construct();
}
public function data_post() {
$user = array(
'id' => $params['id']
);
$this->response(array('status'=>'success'), 200);
}
}
and i amd using rest add on to check web services working or not but i am getting below error.
Fatal error: Uncaught exception 'Exception' with message 'Format class does not support conversion from "php".' in /home/magnetic/public_html/touch/order-form/application/libraries/Format.php:51 Stack trace: #0 /home/magnetic/public_html/touch/order-form/application/libraries/Format.php(31): Format->__construct('{"id": "restCli...', 'php') #1 /home/magnetic/public_html/touch/order-form/application/libraries/REST_Controller.php(247): Format->factory('{"id": "restCli...', 'php') #2 /home/magnetic/public_html/touch/order-form/application/controllers/json.php(6): REST_Controller->__construct() #3 /home/magnetic/public_html/touch/order-form/system/core/CodeIgniter.php(308): json->__construct() #4 /home/magnetic/public_html/touch/order-form/index.php(202): require_once('/home/magnetic/...') #5 {main} thrown in /home/magnetic/public_html/touch/order-form/application/libraries/Format.php on line 51
http://awesomescreenshot.com/0cd38frz01 is screenshot of rest addon error
Please let me know what else i need to do if anything remaining in my code and please let me know the whole process of using rest server for 'post' web services. Thanks in advance