title: How to read a value in WebAPI sent via WebClient.UploadString?
body: <p>I want to POST data to WebAPI. Ideally I would just do:</p>
  
  <pre><code>http:www.myawesomesite.com?foo=bar
  </code></pre>
  
  <p>As a POST. But to my specific question, I am trying to use:</p>
  
  <pre><code>using(var webClient = new WebClient())
  {
      client.uploadString("http:www.myawesomesite.com", "POST", "foo=bar");
  }
  </code></pre>
  
  <p><a href="https://msdn.microsoft.com/en-us/library/d0d3595k(v=vs.110).aspx" rel="nofollow">But that converts "foo=bar" to a bye array</a>. Okay fine, I'm just trying to get it to work at this point.</p>
  
  <p>My Web API controller looks like this:</p>
  
  <pre><code>[HttpPost]
  public void MashPotatos(string foo)
  {
      potatoMasher.Mash(foo);
  }
  </code></pre>
  
  <p>But I get <code>The remote server returned an error: (404) Not Found.</code> First off, I thought WebAPI would automatically grock that data for me even if it was in the body of the request. But more importantly, I just want to be able to get it to work.</p>
  
  <p>Ideally, I'd like to leave the WebAPI method in a form such that you can still invoke it by using a query string with a POST verb.</p>