title: get a userID of a facebook user with http request C# WPF
body: <p>I'm trying to get the userID of a Facebook user, I already have the access_token and I use http request to do it. My simple problem is that : I want the user's id but my program just crash... I use WPF, C# Here is my little call :</p>
  
  <pre><code>var url = string.Format("https://graph.facebook.com/me?access_token=" + token + "&amp;response_type=id");
  
          var req = WebRequest.Create(url);
          req.Method = "POST";
          req.ContentType = "application/x-www-form-urlencoded";
  
          string postData = "'access_token='" + token;
  
          byte[] byteArray = Encoding.UTF8.GetBytes(postData);
          var stream = req.GetRequestStream();
          stream.Write(byteArray, 0, byteArray.Length);
          stream.Close();
  
          WebResponse response = req.GetResponse();
          aTextBox.Text = ((HttpWebResponse)response).StatusDescription;
          stream = response.GetResponseStream();
          StreamReader reader = new StreamReader(stream);
  </code></pre>
  
  <p>Thanks!</p>