In order to convert rtf to html, send the rtf file .
curl -F "rtf=@sample.rtf" http://localhost:9022/convert > sample.html
<php $ch = curl_init("http://localhost:9022/convert"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, [ 'rtf' => new \CurlFile(__DIR__.'/sample.rtf','text/rtf','sample.rtf') ]); $result = curl_exec($ch); file_put_contents("output.html", $result);
This system is using libreoffice as the engine to support this function.