title: WebClient.UploadValues is not making a post request in c#
body: <p>I am trying to upload a single jpeg image to a PHP script. This my console app <code>program.cs</code>:</p>
  
  <pre><code>class Program
  {
      static void Main(string[] args)
      {
          Stopwatch stopWatch = new Stopwatch();
          stopWatch.Start();
  
          string result = UploadHandler.Post(
              "http://localhost/upload_test",
              "frame.jpg"
          );
  
          stopWatch.Stop();
          TimeSpan ts = stopWatch.Elapsed;
          string elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}",
              ts.Hours, ts.Minutes, ts.Seconds,
              ts.Milliseconds / 10);
  
          Console.WriteLine("Result : {0}", result);
          Console.WriteLine("File uploaded in : {0}", elapsedTime);
          Console.ReadKey();
      }
  }
  </code></pre>
  
  <p>This is my <code>UploadHandler</code> class:</p>
  
  <pre><code>class UploadHandler
  {
      public static string Post(string serverUrl, string filePath)
      {
          string result = "";
          using (WebClient client = new WebClient())
          {
              byte[] response = client.UploadValues(serverUrl, new NameValueCollection()
              {
                  { "frameData", ToBase64(filePath) }
              });
              result = Encoding.Default.GetString(response);
          }
          return result;
      }
  
      private static string ToBase64(string filePath)
      {
          return Convert.ToBase64String(
              File.ReadAllBytes(filePath)
          );
      }
  }
  </code></pre>
  
  <p>and this is my php script that receives the upload:</p>
  
  <pre><code>&lt;?php
  
  if (count($_POST) &amp;&amp; isset($_POST['frameData']))
  {
      file_put_contents('frame.jpg', base64_decode($_POST['frameData']));
      exit("OK");
  }
  else
  {
      print_r($_POST);
      exit("INVALID REQUEST");
  }
  </code></pre>
  
  <p>And this is the response I get:</p>
  
  <p><img src="https://i.stack.imgur.com/Dvyv1.png" alt="enter image description here"></p>
  
  <p>Any idea why this might be? It appears the C# app isn't making a HTTP POST request.</p>