title: How to overcome error in (HttpWebResponse)HttpReq.GetResponse()?
body: <p>I am getting a Error in GetResponse() method while using it in visual studio 2012 for mobile,but it works fine in visual studio desktop version,Please Help,</p>
  
  <blockquote>
    <p>The Code is as shown</p>
  </blockquote>
  
  <pre><code>  var myurl = "https://api.forecast.io/forecast/4b1ac2aa66db99adcf90578132b507d4/";
  
  
          string url = myurl + lat + "," + lon; 
  
          var request = HttpWebRequest.Create(url);
          request.ContentType = "application/json";
          request.Method = "GET";
          using (HttpWebResponse response = request.GetResponse () as HttpWebResponse) {            
              if (response.StatusCode != HttpStatusCode.OK) {
                  //Console.Out.WriteLine("Error fetching data. Server returned status code: {0}", response.StatusCode);
              }
              using (StreamReader reader = new StreamReader (response.GetResponseStream ())) {
                  string content = reader.ReadToEnd ();
                  Console.WriteLine (reader.ReadToEnd ());
                  if (string.IsNullOrWhiteSpace (content)) {
                      //Console.Out.WriteLine("Response contained empty body...");
                  } else {   
                      myopt = Newtonsoft.Json.JsonConvert.DeserializeObject&lt;RootObject&gt; (content);
  
  
                      System.DateTime dtDateTime = new DateTime (1970, 1, 1, 0, 0, 0, 0);
                      double unixTimeStamp = 1392316200;
                      dtDateTime = dtDateTime.AddSeconds (myopt.hourly.data [23].time).ToLocalTime ();
  </code></pre>
  
  <p>myopt is object of rootobject class for various Json classes.
  Please Help me as I am pretty new to this field,Thanks</p>