I wanted to remove image background using the https://remove.bg api from their documentation since am new to use of curl here is what i have come up with
$url = "https://api.remove.bg/v1.0/removebg";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'x-api-key: my-api-key',
'image_url:https://example.com/image-to-remove-bg.png'
));
$server_output = curl_exec ($ch);
curl_close ($ch);
print_r($server_output);
But it's returning empty body; will you please help me out or point me where am doing it wrong.