I end up using curl like this…
function curl_post($url,$payload,$options){
$headers = [
'X-DreamFactory-Api-Key:'.$options['headers']['X-DreamFactory-Api-Key'].'',
'X-DreamFactory-Session-Token:'.$options['headers']['X-DreamFactory-Session-Token'].'',
'Content-type:application/json'
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER,$headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, TRUE);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
$curlresponse = curl_exec($ch);
curl_close($ch);
return $curlresponse;
}
$baseurl="baseserviceurl";
$options = [];
$options['headers'] = [];
$options['headers']['X-DreamFactory-Api-Key'] = $platform['session']['api_key'];
$options['headers']['X-DreamFactory-Session-Token'] = $platform['session']['session_token'];
$options['headers']['Content-Type'] = 'application/json';
$userData = [
'last_name' => "string",
'first_name' => "string",
'email' => "someemail",
'display_name' => "string"
];
$insertResponse = curl_post($baseurl.'user/register',$userData,$options);
Hope it helps someone with similar problem.