I’m under to try getting response from oracle bi publisher using php-curl with header as multipart/form-data but the result it’s Request failed
I’m trying also to getting the code from postman directly because it work fine with it but also result it’s Request failed
So please help to fix the code
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'HOST:PORT/xmlpserver/services/rest/v1/reports/OBTF%2Frapport%2FECHANCE%20LC%2Fapi2/run');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, array('ReportRequest' => '{\"attributeFormat\":\"html\",\"attributeTemplate\":\"Publisher Template\"}'));
curl_setopt($ch, CURLOPT_USERPWD, 'login' . ':' . 'password');
$headers = array();
$headers[] = 'Content-Type: multipart/form-data';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
echo $result;
curl_close($ch);
@CBroe