I want to retrieve my profile
The HealthProfile.aspx defines PrintProfile() method that uses
following classes:
GAuthSubRequestFactory
HealthService
HealthQuery
HealthFeed
XMLExtension and others
The output is parsed and neatly displayed. This is great.

But the Google Health Data API tells us to use HTTP requests and
headers. So I wrote something using HttpWebRequest and HttpWebResponse
class.
I don't know how to parse the HttpWebResponse output using CCR related
tags (similar to the example code HealthProfile.aspx referenced above)
and get the various profiles in a neat manner instead of me parsing
the response.

Here is my code. Please advise..

            string request;
            string response;
            System.Text.StringBuilder respBody = new StringBuilder();
            HttpWebRequest httprequest;
            HttpWebResponse httpresponse;

            request = "https://www.google.com/h9/feeds/profile/
default";
            httprequest =(HttpWebRequest)HttpWebRequest.Create
(request);
            httprequest.ContentType = "application/atom+xml";
            httprequest.Headers.Set("Authorization", "AuthSub token="
+ (String) Session["token"]);
            //httprequest.Headers.Set("Authorization","GoogleLogin
auth=" + authCode.Trim());
            httpresponse = (HttpWebResponse)httprequest.GetResponse();
            Encoding enc = System.Text.Encoding.GetEncoding(1252);
            StreamReader loResponseStream = new StreamReader
(httpresponse.GetResponseStream(), enc);
            string Response = loResponseStream.ReadToEnd();
            loResponseStream.Close();
            httpresponse.Close();
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Health Developers" 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/googlehealthdevelopers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to