Это командная строка:
curl --silent --header "Authorization: MyLogin auth=xxxxxxxxxxxxxxxxxxx" "https://www.myweb.com/"
Я это то, что у меня есть (пробовал все виды вариаций с заголовком)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://www.myweb.com");
curl_setopt($ch,CURLOPT_HTTPHEADER,array('Authorization: MyLogin','auth: xxxxxxxxxxxxxxxxxxx'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
echo $output;
Я думаю, что я испортилЗаголовок, любая помощь будет высоко ценится.Спасибо.
Добавлено * Это то, с чем я на самом деле работаю
http://code.google.com/apis/gdata/articles/using_cURL.html#authenticating
Я просто переписал, и теперь это работает, вот что у меня есть:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Authorization: GoogleLogin auth=$authCode"));
//curl_setopt($ch, CURLINFO_HEADER_OUT, true); // for debugging the request
//var_dump(curl_getinfo($ch,CURLINFO_HEADER_OUT)); //for debugging the request
$response = curl_exec($ch);
curl_close($ch);
echo $response;