I am unable to execute a post request form Custom PHP server side script on DF version 2.2.
Also note that same script works fine on DF version 2.1.1
Here is the post contents,
{"resource":[{"devid":"20160022","event":"0000","time":"2016-05-03 18:21:14","result":"PASS","etype":"EVENT_IGNITION_KEYED","bac":"255","image":"","lat":"5.000000","lon":"5.000000","speed":"0.00"}]}
Response:
{"status_code":400,"content":{"error":{"context":null,"message":"{"error":{"context":null,"message":"No record(s) detected in request.","code":400}}","code":400}},"content_type":null,"format":201}
The script collects the HTTP post request and does a post using platform.api functions as shown below.
$api = $platform['api'];
$post = $api->post;
$in_content = $event['request']['content'];
//Store log data
$query = 'http://127.0.0.1/api/v2/mysql/_table/log?api_key=ba83d0d41ab0201f6674ed22ba307c282a0d78aef2fcadb6274d830e1172961c';
$result = $post($query,$in_content);
$event['response']['content_type'] = "application/json";
$event['response']['content'] = $result;
Ran this request from fiddler and got error of No records found in request.
Please could anyone help.