title: wp8 HttpWebRequest POST not sending post values along
body: <p>Im kind of stuck with a HttpWebRequest while sending post values and i dont know what the problem is.</p>
  
  <p>Hopefully anyone is able to help me with this.</p>
  
  <p>this is my code </p>
  
  <pre><code>private async void loggingIn(string url, string postdata)
      {
          if (NetworkInterface.GetIsNetworkAvailable())
          {
              try
              {
                  var request = WebRequest.Create(new Uri(url)) as HttpWebRequest;
                  request.Method = "POST";
  
                  byte[] data = Encoding.UTF8.GetBytes(postdata);
                  request.ContentLength = data.Length;
                  using (var requestStream = await Task&lt;Stream&gt;.Factory.FromAsync(request.BeginGetRequestStream, request.EndGetRequestStream, request))
                  {
                      await requestStream.WriteAsync(data, 0, data.Length);
                  }
  
  
                  WebResponse responseObject = await Task&lt;WebResponse&gt;.Factory.FromAsync(request.BeginGetResponse, request.EndGetResponse, request);
                  var responseStream = responseObject.GetResponseStream();
                  var sr = new StreamReader(responseStream);
                  string received = await sr.ReadToEndAsync();
                  MessageBox.Show(received);
              }
              catch
              {
  
              }
          }
      }
      private void Button_Click(object sender, RoutedEventArgs e)
      {
          string url = "localhost/test.php";
          string password = passwordBoxLogin.Password;
          string username = usernameBoxLogin.Text;
  
          string postdata = "password=" + password +"&amp;username="+username;
  
          loggingIn(url,postdata);
      }
  </code></pre>
  
  <p>The problem is that my server does not receive any values from the POST request.
  but i do get a response from the server.</p>
  
  <p>this is what i use to check the code on my php server</p>
  
  <pre><code>&lt;?php
     echo $_POST['username'];
     echo"-";
     echo $_POST['password'];
  ?&gt;
  </code></pre>
  
  <p>the only thing i get returned is the -</p>
  
  <p>Thanks in advance for helping me out :)</p>
  
  <p>It just started working without anychanges.</p>
  
  <p>For now case closed!</p>