The name/value pairs are in the body of the response.  Your response
will likely be 1 line:
Token=THEVALUEOFTHETOKEN

The Utilities.ParseValueFormStream method should work, but use the
string "Token" instead of GoogleAuthentication.AuthSubToken, as that
value is currently "token", which is incorrect.

Cheers,
-Ryan



On Dec 4, 6:23 pm, "gcal programmer" <[EMAIL PROTECTED]> wrote:
> Since my application is not registerd with google , secure=0 solves the
> problem of notAuthorized error. I do get a response also. I checked the
> response's status code  which says 'OK'...So there is no problem until
> i get a response from the authSubSessionToken request. after i get the
> response i am not able to access the session token that comes with the
> response. I tried two ways to access the sessionToken...One is the one
> in which i checked all the headers of the response for the token
> header...That didnt work since there was no header with that name...
> The second method i used is this...resp is the response
>
> Dim strSessionToken As String =
> Utilities.ParseValueFormStream(resp.GetResponseStream,
> GoogleAuthentication.AuthSubToken)
>
> With this approach i get an error saying "Not able to read the
> stream"...I really cant get what i am doing wrong...Does the status
> code= 'OK'  mean that there was a good response?? I shall show you the
> code i have used again...
>
> Dim sessionTokenRequest As HttpWebRequest =
> CType(WebRequest.Create("https://www.google.com/accounts/AuthSubSessionToken";),
> HttpWebRequest)
>             sessionTokenRequest.Method = HttpMethods.Get
>             sessionTokenRequest.MaximumResponseHeadersLength = 50
>             Dim Aburi As String =
> sessionTokenRequest.RequestUri.AbsoluteUri()
>             sessionTokenRequest.ProtocolVersion = HttpVersion.Version11
>             sessionTokenRequest.ContentType =
> "application/x-www-form-urlencoded"
>             sessionTokenRequest.Headers.Add("Authorization", "AuthSub
> token=""" & strGoogleToken & """")
>             sessionTokenRequest.UserAgent = "CS/1.0.0"
>             sessionTokenRequest.Accept = "text/html, image/gif,
> image/jpeg, *; q=.2, */*; q=.2"
>             sessionTokenRequest.Connection =
> sessionTokenRequest.KeepAlive
>             Dim resp As HttpWebResponse =
> sessionTokenRequest.GetResponse()


--~--~---------~--~----~------------~-------~--~----~
 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