title: Post request to php Xamarin.Forms
body: <p>I have this function inside a static class that sends a post request to a php code on my server:</p>
  
  <pre><code>public static string phone;
  
  public static async Task&lt;string&gt; CheckPhone()
  {
      string url = "my url...";
      var form = new CheckPhoneForm { Phone = phone };
      var content = JsonConvert.SerializeObject(form);
  
      HttpClient client = new HttpClient();
      HttpResponseMessage response = await client.PostAsync(url, new StringContent(content));
      if (response.IsSuccessStatusCode == false) return "ERROR";
      return await response.Content.ReadAsStringAsync();
  }
  </code></pre>
  
  <p>CheckPhoneForm class:</p>
  
  <pre><code>public class CheckPhoneForm
  {
      public string Phone { get; set; }
  }
  </code></pre>
  
  <p>php code:</p>
  
  <pre><code>&lt;?php
  
      $phone = $_POST["Phone"];
  
      //rest of the code.....
  
  ?&gt;
  </code></pre>
  
  <p>for some reason the $phone in the php file doesn't receive the data sent from the c# code and it stays empty.
  can anyone tell me what Im doing wrong?</p>