title: Converting code c# sync httprequest to async
body: <p>I have a problem with this codes, i need to convert this Json httprequest to an async method, in order to use it in a WP7 C# application, here is the code, i really need help on this one.</p>
  
  <p>it shows errors in the following statements:</p>
  
  <p>1) myReq.ContentLength = postData.Length;--> ContentLength is not contains this type of method</p>
  
  <p>2) webresponse = (HttpWebResponse)myReq.GetResponse(); --> is a Sync method and is not contained on httpresponse metod</p>
  
  <p>3) StreamWriter stOut = new StreamWriter(myReq.GetRequestStream(), System.Text.Encoding.ASCII); --> is a Sync method and is not contained on httpresponse metod</p>
  
  <p>4) GoogleCell cell = JsonConvert.DeserializeObject(Response);--> method overloaded or missing a conversion....and the conversion is on the 3rd error. </p>
  
  <pre><code>  /// internal google cell info to post
  
      public GoogleCell GetCellInfo(string lac, string mnc, string mcc, string cellID)
      {
  
          HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create("https://www.google.com/loc/json");
          myReq.Method = "POST";
          myReq.ContentType = "application/jsonrequest";
          string postData = "{\"cell_towers\": [{\"location_area_code\": \"" + lac + "\", \"mobile_network_code\": \"" + mnc + "\", \"cell_id\": \"" + cellID + "\", \"mobile_country_code\": \"" + mcc + "\"}], \"version\": \"1.1.0\", \"request_address\": \"true\"}";
          myReq.ContentLength = postData.Length;
  
          StreamWriter stOut = new StreamWriter(myReq.GetRequestStream(), System.Text.Encoding.ASCII);
          stOut.Write(postData);
          stOut.Close();
  
          HttpWebResponse webresponse;
          webresponse = (HttpWebResponse)myReq.GetResponse();
          Encoding enc = System.Text.Encoding.UTF8;
          StreamReader loResponseStream = new StreamReader(webresponse.GetResponseStream(), enc);
  
          string Response = loResponseStream.ReadToEnd();
          loResponseStream.Close();
          webresponse.Close();
  
          GoogleCell cell = JsonConvert.DeserializeObject(Response);
          return cell;
  
  
          }
      }
  </code></pre>