RESTful service errors out when POST array is *not* empty RESTful service errors out when POST array is *not* empty curl curl

RESTful service errors out when POST array is *not* empty


I think CSRF protection is set to TRUE in config file for the REST application. You either need to pass the CSRF token name and CSRF hash as its value in your curl POST request array OR turn it off by changing its value to FALSE

$config['csrf_protection'] = FALSE;


You can also disable the csrf only for the api requests.
Example: Edit the config.php and change the $config['csrf_protection'] line to

$config['csrf_protection'] = TRUE;if (isset($_SERVER["REQUEST_URI"])       && stripos($_SERVER["REQUEST_URI"],'/api') !== FALSE) {  $config['csrf_protection'] = FALSE;}


CSRF is a bitch. Turn it off:

$config['csrf_protection'] = FALSE; 

In later versions you can add whitelist IPs/domains, which your client will be one of them.