1

hi Sorry for my weak English. I'm trying to receive the JSON data from Sim800 on my Server using Codeigniter. when in config.php file i set the $config['csrf_protection'] = TRUE; the Server Response 403 error and when it's false Server Response 200 and everything is OK.what can i do for this problem? for now in config.php i add this: $config['csrf_exclude_uris'] = array('customer/query');,Is there another way?


in my client side Sim800 module I'm using this commands.

AT+SAPBR=3,1,"CONTYPE","GPRS"
AT+SAPBR=3,1,"APN","mtnirancell"
AT+SAPBR=1,1
AT+SAPBR=2,1
AT+HTTPINIT
AT+HTTPPARA="CID",1
AT+HTTPPARA="URL","http://www.mysiteaddress.ir/customer/query"
AT+HTTPPARA="CONTENT","application/json"
AT+HTTPDATA=20,10000 //data is 20 Bytes,maximum latency time is 10000 ms.
// Wait a few moments to Receive "DOWNLOAD" from sim800c module
{"data":"my sensor value"} // The data I want to send

AT+HTTPACTION=1 // send data with POST method

after this commands module response

OK

+HTTPACTION: 1,403,86 // 403 error

and for PHP server I'm using this codes:

$request_body="";
$request_body = file_get_contents('php://input');
$record = urldecode($request_body);
$record = json_decode($request_body,true);

0 Answers0