I tried url encoding the string but I get the same error. Here is my
code
($authStr and $sessionStr are from previous replies. I know they are
correct because I have used the same code to write calendar entries):
$postStr =
urlencode("?start-min=2001-03-16T00:00:00&start-max=2008-03-24T23:59:59");
$url= "http://www.google.com/";
$page = "/calendar/feeds/default/private/full" . $sessionStr;
$header = "POST ".$page." HTTP/1.0 \n";
$header .= "Content-type: application/atom+xml\n";
$header .= "Content-length: " . strlen($postStr) . " \n";
$header .= "Authorization: GoogleLogin auth=" . $authStr . "\n";
$header .= "Content-transfer-encoding: text\n\n";
$header .= $postStr;
$ch2 = curl_init();
curl_setopt($ch2, CURLOPT_URL, $url);
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch2, CURLOPT_TIMEOUT, 10);
curl_setopt($ch2, CURLOPT_HEADER, true);
curl_setopt($ch2, CURLOPT_CUSTOMREQUEST, $header);
$response = curl_exec($ch2);
----------------------
$response looks like:
HTTP/1.0 400 Bad Request Content-Type: text/plain;charset=iso-8859-1
Cache-control: private Date: Wed, 04 Oct 2006 12:59:31 GMT Server:
GFE/1.3
Connection: Close org.xml.sax.SAXParseException: Content is not allowed
in
prolog.
By the way, I tried doing this with GET. The response in that case
was:
HTTP/1.0 501 Not Implemented Date: Wed, 04 Oct 2006 13:10:40 GMT
Content-Type: text/html Server: GFE/1.3 Connection: Close
Content-Length:
370
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Calendar Data API" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-calendar-help-dataapi
-~----------~----~----~----~------~----~------~--~---