title: how to post plain text to ASP.NET Web API endpoint?
body: <p>I have an ASP.NET Web API endpoint with controller action defined as follows :</p>
  <pre><code>[HttpPost]
  public HttpResponseMessage Post([FromBody] object text)
  </code></pre>
  <p>If my post request body contains plain text ( i.e. should not be interpreted as json, xml, or any other special format ), then I thought I could just include following header to my request :</p>
  <pre><code>Content-Type: text/plain
  </code></pre>
  <p>However, I receive error :</p>
  <pre><code>No MediaTypeFormatter is available to read an object of type 'Object' from content with media type 'text/plain'.
  </code></pre>
  <p>If I change my controller action method signature to :</p>
  <pre><code>[HttpPost]
  public HttpResponseMessage Post([FromBody] string text)
  </code></pre>
  <p>I get a slightly different error message :</p>
  <blockquote>
  <p>No MediaTypeFormatter is available to read an object of type 'String' from content with media type 'text/plain'.</p>
  </blockquote>