我想使用https://remove.bg api 从他们的文档中删除图像背景,因为我不熟悉 curl 这里是我想出的
$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);
但它返回的是空的身体;请你帮帮我或指出我哪里做错了。