title: Cannot read body data from web api POST
body: <p>I'm trying to extract some data out of a request in the new Asp.Net Web Api. I have a handler setup like this:</p>
  
  <pre><code>public class MyTestHandler : DelegatingHandler
  {
      protected override System.Threading.Tasks.Task&lt;HttpResponseMessage&gt; SendAsync(HttpRequestMessage request, System.Threading.CancellationToken cancellationToken)
      {
          if (request.Content.IsFormData())
          {
              request.Content.ReadAsStreamAsync().ContinueWith(x =&gt; {
                  var result = "";
                  using (var sr = new StreamReader(x.Result))
                  {
                      result = sr.ReadToEnd();
                  }
                  Console.Write(result);
              });
          }
  
          return base.SendAsync(request, cancellationToken);
      }
  }
  </code></pre>
  
  <p>This is my http request:</p>
  
  <pre><code>POST http://127.0.0.1/test HTTP/1.1
  Connection: Keep-Alive
  Content-Length: 29
  Content-Type: application/x-www-form-urlencoded
  Expect: 100-continue
  Host: 127.0.0.1
  
  my_property=my_value
  </code></pre>
  
  <p>the problem is that no matter how I try to read the info from <code>request.Content</code> it's always empty. I've tried</p>
  
  <pre><code>request.Content.ReadAsStreamAsync
  request.Content.ReadAsFormDataAsync
  request.Content.ReadAs&lt;FormDataCollection&gt;
  </code></pre>
  
  <p>as well as </p>
  
  <pre><code>    [HttpGet,HttpPost]
      public string Index([FromBody]string my_property)
      {
          //my_property == null
          return "Test";
      }
  </code></pre>
  
  <p>None if it works. I cannot get the data out of the body. I'm hosting inside IIS on Windows 7 and using Fiddler to submit the request. What am I doing wrong?</p>