Actually my fix was a dead end, you can change HTTP to CABBAGES and it
still spits out the same error.  The error is still with the 302.  Any
ideas, web searching isn't being productive.

Thanks

Pete

On Nov 27, 6:12 pm, Pete <[EMAIL PROTECTED]> wrote:
> Nearly fixed.  It needed a HTTPS instead of HTTP, now it is saying:
>
> POST requests require a Content-length header.
>
> though this is clearly present below...
>
> Any ideas?
>
> On Nov 27, 5:54 pm, Pete <[EMAIL PROTECTED]> wrote:
>
> > I am writing some code for our google site to check on mail account
> > usage.  I have extracted the Google API token and pass it to this
> > function.  I realise there is a PHP example out there using CURL, the
> > server we are using doesn't have CURL so I'm trying to hard code it.
> > What am I doing wrong ?
>
> > function create_reports($token, $domain = "teachfirst.org.uk", $date =
> > "2008-11-20", $page = "1", $reportType="daily",
> > $reportName="activity")
> > {
> > //Variables
> >         $data = <<< END
> >         <?xml version="1.0" encoding="UTF-8"?>
> >         <rest xmlns="google:accounts:rest:protocol"
> >             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
> >             <type>Report</type>
> >             <token>{$token}</token>
> >             <domain>{$domain}</domain>
> >             <date>{$date}</date>
> >             <page>{$page}</page>
> >             <reportType>{$reportType}</reportType>
> >             <reportName>{$reportName}</reportName>
> >         </rest>
> > END;
> >         $host="66.249.91.99"; //thatswww.google.comincasethe DNS is giving
> > issues
> >         $method="post";
> >         $path="/hosted/services/v1.0/reports/ReportingData";
> >     $method = strtoupper($method);
> > //sending raw HTTP headers
> >         $fp = fsockopen('ssl://'.$host, 443);
> >                 fputs($fp, "$method $path HTTP/1.1\r\n");
> >                 fputs($fp, "Host: $host\r\n");
> >                 fputs($fp, "Content-type: application/atom+xml\r\n");
> >                 fputs($fp, "Content-Length: " . strlen($data) . "\r\n");
> >                 fputs($fp, "Connection: Close\r\n\r\n");
> >                 fputs($fp, $data);
> > //getting the reply
> >                 while (!feof($fp))
> >                 {
> >                         $buf .=fgets($fp);
> >                 }
> >                 echo $buf;
> >                 fclose($fp);
>
> > }
>
> > ERROR GIVEN
> > #############
> > HTTP/1.1 302 Found Location:http://www.google.comDate:Thu, 27 Nov
> > 2008 17:14:52 GMT Content-Type: text/html; charset=UTF-8 Server: GFE/
> > 1.3 Content-Length: 218 Connection: Close
>
> > 302 Moved
> > The document has moved here
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Apps APIs" 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-apps-apis?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to