I finally figured it out. Thanks anyway.
On Dec 23, 10:52 am, "[email protected]" <[email protected]> wrote:
> I got the token which I used in a header .
>
> <?php
> $host = 'google.com';
> $request = '/accounts/AuthSubSessionToken';
> $errno="";
> $errstr="";
> $header = "GET $request HTTP/1.1\r\n\r\n";
> $header=$header . "Content-Type: application/x-www-form-urlencoded\r
> \n";
> $header=$header . "Authorization: AuthSub token='CKG8qYWxAxDIkLtU'\r
> \n";
> $header=$header . "User-Agent: Java/1.5.0_06\r\n";
> $header=$header . "Host:www.google.com\r\n";
> $header=$header . "Accept: text/html, image/gif, image/jpeg, *; q=.2,
> */*; q=.2\r\n";
> $header=$header . "Connection: keep-alive\r\n";
>
> $fp = fsockopen( $host, 80, $errno, $errstr, 30 );
> if( $fp )
> {
> fputs ($fp, $header );
> $result = '';
>
> while( !feof( $fp ) )
> $result =$result . fgets( $fp, 1024 );
>
> fclose ($fp);} echo $result;
>
> ?>
>
> On sending the request I get a 401 Bad request error. Could anyone
> help me with this?
>
> Thank You
> Suzzane
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Contacts 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-contacts-api?hl=en
-~----------~----~----~----~------~----~------~--~---