Greetings,

      I'm trying to consume the Contacts feeds programmatically
using .NET for HOSTED accounts but I must first perform an HTTP
ClientLogin request. I was wondering if it's possible to do this
programmatically as well using .NET's HttpWebRequest.

My code looks like this:

       HttpWebRequest restRequest;
       HttpWebResponse restResponse;

       string accountType = "HOSTED";
       string Email = "[email protected]";
       string Passwd = "pass";
       string service = "cp";
       string source = "exampleCo-exampleApp-1";

       ASCIIEncoding encoding=new ASCIIEncoding();
       string postData="accountType="+accountType;
       postData += ("&Email="+Email);
       postData += ("&Passwd="+Passwd);
       postData += ("&service="+service);
       postData += ("&source="+source);
       byte[]  data = encoding.GetBytes(postData);

       restRequest = (HttpWebRequest) WebRequest.Create("https://
www.google.com/accounts/ClientLogin");

       restRequest.Method = "POST";
       restRequest.ContentType="application/x-www-form-urlencoded";
       restRequest.ContentLength = data.Length;
       Stream newStream = restRequest.GetRequestStream();
       newStream.Write(data,0,data.Length);
       newStream.Close();

       restResponse = (HttpWebResponse)restRequest.GetResponse();
       Stream responseStream = response.GetResponseStream();
 --------------------------------

But for some reason the responseStream is not returning the three
tokens "Auth", "SID" and "LSID" which I need to be able to fetch the
private contact feeds.

Any help would be appreciated. Thanks



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

Reply via email to