title: Why am I getting a null value from the Post method on a Web API Controller?
body: <p>I have a pretty simple WebAPI class, that returns JSON for my <strong>Get</strong> methods.  My <strong>Post</strong> method is:</p>
  
  <pre><code>    // POST: api/Diff
      public void Post([FromBody]string value)
      {
          System.Diagnostics.Debug.WriteLine(value);
      }
  </code></pre>
  
  <p>and I'm calling both methods from a console application:</p>
  
  <pre><code>        using (var client = new HttpClient())
          {
              // New code:
              client.BaseAddress = new Uri("http://localhost:50541/");
              client.DefaultRequestHeaders.Accept.Clear();
              client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
  
              // New code:
              HttpResponseMessage response = await client.GetAsync("api/diff/1");
              if (response.IsSuccessStatusCode)
              {
                  var diff = await response.Content.ReadAsAsync&lt;Diff&gt;();
                  Console.WriteLine("{0}\t${1}", diff.Text, diff.Revision);
              }
  
              var blah = new Diff() { Text = "Gizmo", Revision = 999};
              response = await client.PostAsJsonAsync("api/diff", blah);
  </code></pre>
  
  <p>The <strong>Get</strong> call works. I verified in the debugger that before the 
  PostAsJson method is callled that <em>blah</em> is not null.  However in the debugger on the API's post method, <em>value</em> is null.</p>