This is the command line:
curl --silent --header "Authorization: MyLogin auth=xxxxxxxxxxxxxxxxxxx" "https://www.myweb.com/"
I this is what I have (tried all kinds of variations with the header)
$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;
I think I am messing up the header part, any help will be much appreciated. Thanks.
Added* This is what I am actually working with
http://code.google.com/apis/gdata/articles/using_cURL.html#authenticating
I just rewrote it and now it works, this is what i have:
$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;