ccc

CURL: Ejemplos de cabeceras de CURLOPT_HTTPHEADER

$headers = array(
'Content-type: text/plain',
'Content-length: 100'
);

$headers = array(
    'Content-type: application/xml',
    'Authorization: gfhjui',
);

$headers = array(
'Content-Type: text/xml'
);

$headers = array(
            "POST ".$page." HTTP/1.0",
            "Content-type: text/xml;charset='utf-8'",
            "Accept: text/xml",
            "Cache-Control: no-cache",
            "Pragma: no-cache",
            "SOAPAction: 'run'",
            "Content-length: ".strlen($xml_data),
            "Authorization: Basic " . base64_encode($credentials)
        );

$headers = array(
'Content-Type: application/x-www-form-urlencoded'
);

$headers =  array(
'Content-Type:application/json'
);

$headers = array(
"Authorization: Basic".base64_encode($usuario.":".$password)
);

$User_Agent = 'Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31';
$headers = array(
'User-Agent: '.$User_Agent,
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
);

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

No hay comentarios:

Publicar un comentario