Hi,
I’m trying to add a new stream with PHP Curl and REST API, however I’m getting the api error 500.
Request:
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_HTTPHEADER => array(‘Content-Type: application/json; charset=utf-8’, ‘Accept: application/json; charset=utf-8’),
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => ‘http://localhost:8087/v2/servers/defaultServer/vhosts/defaultVHost/applications/live/streamfiles’,
CURLOPT_HTTPAUTH => CURLAUTH_ANY,
CURLOPT_USERPWD => “user:password”,
CURLOPT_CUSTOMREQUEST => “POST”,
CURLOPT_POSTFIELDS => [
‘name’ => ‘Stream01’,
‘serverName’ => ‘defaultServer’,
‘uri’ => ‘host/Stream01/live’
]
));
Response:
{
“message”: “The server encountered an unexpected condition which prevented it from fulfilling the request”,
“success”: false,
“wowzaServer”: “4.7.7”,
“code”: “500”
}