Dim buff As Byte() = Encoding.ASCII.GetBytes("accountType=HOSTED" & 
_
                                                     
"&[email protected]" & _
                                                     "&Passwd=XXXX" & _
                                                     "&service=cp" & _
                                                     
"&source=exampleCo-exampleApp-1")

        Dim request As HttpWebRequest = 
HttpWebRequest.Create("https://www.google.com/accounts/ClientLogin";)
        request.Method = "POST"
        request.ContentType = "application/x-www-form-urlencoded"
        request.ContentLength = buff.Length
        Dim PostData As IO.Stream = request.GetRequestStream
        PostData.Write(buff, 0, buff.Length)
        PostData.Close()

        Dim response As HttpWebResponse = request.GetResponse

        Dim data As IO.Stream = response.GetResponseStream
        Dim reader As New IO.StreamReader(data)
        Dim AuthToken As String = Split(Split(reader.ReadToEnd, vbLf)(2), 
"=")(1)


        request = 
HttpWebRequest.Create("https://www.google.com/m8/feeds/profiles/domain/domain.com/full";)
        request.Method = "GET"
        request.ContentType = "application/x-www-form-urlencoded"
        request.Headers.Add("Authorization", "GoogleLogin auth=" & 
AuthToken)

        response = request.GetResponse              'here is where i get the 
expection
        data = response.GetResponseStream
        reader = New IO.StreamReader(data)
        MsgBox(reader.ReadToEnd)

-- 
You received this message because you are subscribed to the Google
Groups "Google Contacts, Shared Contacts and User Profiles 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://code.google.com/apis/contacts/community/forum.html

Reply via email to