title: How do I bind a simple POST value in ASP.NET WebAPI RC?
body: <p>I have a POST method on one of my API controllers that takes a single string value:</p>
  
  <pre><code>public string Post([FromBody] string foo) {
      return(fooOracle.ValidateFoo(foo) ? "success" : "failure");
  }
  </code></pre>
  
  <p>I'm POSTing to this with the body of the post request as:</p>
  
  <pre><code>foo=123412341234
  </code></pre>
  
  <p>(i.e. it's a regular HTTP POST that you can initiate by submitting a browser form as well as using an HTTP client)</p>
  
  <p>In the release candidate of WebAPI, this has silently stopped working - it just doesn't bind foo any more. To get the code working, I've had to replace the method with this:</p>
  
  <pre><code>public string Post(FormDataCollection form) {
      var foo = form.Get("foo");
      return(fooOracle.ValidateFoo(foo) ? "success" : "failure");
  }
  </code></pre>
  
  <p>This <em>works</em>, but it's kinda messy and involves rather more plumbing to test than the previous version.</p>
  
  <p>Have I missed some subtle change, or has the [FromBody] binding syntax been deprecated in favour of this rather verbose binding syntax? The attribute is still there but it's really not clear what it actually does in the RC version.</p>