I am calling cURL call like below but wanted to convert in to PHP format
curl https://apis.voicebase.com/v2-beta/media \
--header "Authorization: Bearer $token" \
--form media=@/home/harshal/Desktop/100Hz_44100Hz_16bit_30sec.wav\
| tee media-post-response.json | jq '.'
Above cURL wanted to convery in to PHP format like below
set_time_limit(0);
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 0);
curl_setopt($ch, CURLOPT_LOW_SPEED_LIMIT, 0);
curl_setopt($ch, CURLOPT_LOW_SPEED_TIME, 60);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 300);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
$result = json_decode(curl_exec($ch),TRUE);
curl_close($ch);
but getting error of authorization but when I pass parameters to cURL like Token & audioUrl it works. but it does not works when pass parameters like above php CURL_OPT