Hi

I have read the documentation about authentication several times and i
still dont get how i should send a request to the google calendar
service (GET request). I have succeeded in getting a authSub token.
After that this is what the google documentation says.

Documentation
******************************************************
All requests to a Google service must include a valid authentication
token. In general, a request to a Google service will be in the form of
an HTTP GET (or POST if writing new data), with the token referenced in
the request header.

The example below illustrates a request header for a call to the Google
Calendar feed service. This request contains a non-secure token:

GET /calendar/feeds/default/private/full HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Authorization: AuthSub token="GD32CMCL25aZ-v____8B"
User-Agent: Java/1.5.0_06
Host: www.google.com
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive

******************************************************

In order to follow what the documentation said i have written the
following code in asp.net. But all i get is an exception saying
"Unauthorized" .


Dim myRequest As HttpWebRequest =
CType(WebRequest.Create("http://www.google.com/calendar/feeds/[EMAIL 
PROTECTED]/private/full"),
HttpWebRequest)
            myRequest.Method = "GET"
            'myRequest.Headers.Add("GET",
"/calendar/feeds/[EMAIL PROTECTED]/private/full HTTP/1.1")
            myRequest.ContentType = "application/x-www-form-urlencoded"
            myRequest.Headers.Add("Authorization", "AuthSub token="" &
strGoogleToken & """)
            myRequest.UserAgent = "c#"
            'myRequest.Headers.Add("Host", "http://www.google.com";)
            myRequest.Accept = "text/html, image/gif, image/jpeg, *;
q=.2, */*; q=.2"
            myRequest.Connection = myRequest.KeepAlive
            myRequest.GetResponse()


Here the strGoogleToken contains the token value after authSub. Please
help me with this. If anyone can give the code for sending a request to
the google service it would be really nice. Or even an explanation for
this exception that i am getting will be helpful. Please help.


--~--~---------~--~----~------------~-------~--~----~
 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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to