Hi! I use this function with 'fpoen', but I need to use 'curl' instead.
function rest_auth_xml($url,$method,$token,$chave,$xml)
{
$auth = sprintf('Authorization: Basic %s',base64_encode("$token:$chave") );
$opts = array(
'http'=>array(
'method'=>$method,
'header'=>"Content-Type: text/xml\r\n" .
$auth."\r\n",
'content'=>$xml
)
);
$context = stream_context_create($opts);
/* Sends an http request to www.example.com
with additional headers shown above */
$fp = fopen($url, 'r', false, $context);
$conteudo = stream_get_contents($fp);
fclose($fp);
return $conteudo;
}
If anyone knows how to migrate, send your answer! Than you!