title: JSON String upload to PHP with Webclient upload string
body: <p>There is code below i would like to achieve to communicate wth php server is:
  Unfortunately there is nothing posting to php side (array or single string). var_dump returns null</p>
  
  <p>****added to php to read RAW post data :**now it works</p>
  
  <pre><code>$json = file_get_contents('php://input');
      $obj = json_decode($json);**
  </code></pre>
  
  <p>code</p>
  
  <pre><code>   private void webClient2_UploadStringCompleted(object sender, UploadStringCompletedEventArgs e)
      {
          MessageBox.Show(e.Result);
          MessageBox.Show("ss");
      }
      private void btn_soksok_Click(object sender, RoutedEventArgs e)
      {
  
          StudentName student2 = new StudentName
          {
              f = "Craig",
              l = "Playstead",
          };
  
  
         // string datax = JsonConvert.SerializeObject(student2);
          string datax = "asdf";
             Uri uri = new Uri("http://XXX.co/up.php");
             WebClient webClient2 = new WebClient();
          //webClient2.DownloadStringCompleted += webClient_DownloadStringCompleted;
             webClient2.UploadStringCompleted += webClient2_UploadStringCompleted;
  
            // webClient2.Headers["Content-Type"] = "application/json; charset=utf-8";
             //webClient2.Headers["Accept"] = "application/json";
  
  
             webClient2.UploadStringAsync(uri, "POST", datax);
             MessageBox.Show(datax);
  
      }
  </code></pre>
  
  <p>class object</p>
  
  <pre><code>   public class StudentName {
          public string f { get; set; }
          public string l { get; set; }
  
  
      }
  </code></pre>
  
  <p>and php side</p>
  
  <pre><code>&lt;?php
  //header('Content-Type: application/json;charset=utf-8');
  var_dump($_POST);
  $x = json_decode($_POST[0]);
  echo $x;
  ?&gt;
  </code></pre>