title: Very Simple AngularJS $http POST Results in '400 (Bad Request)' and 'Invalid HTTP status code 400'
body: <p>I have a very simple .NET Web API hosted in Azure, with two very simple methods:</p>
  
  <pre><code>[EnableCors(origins: "http://simpleapiearl.azurewebsites.net", headers: "*", methods: "*")]
  public class EnvelopesController : ApiController {
      // GET: api/Envelopes
      public IEnumerable&lt;string&gt; Get() {
          return new string[] { "value1", "value2" };
      }
  
      // POST: api/Envelopes
      public string Post([FromBody]Envelope env) {
          return "rval: " + env + " (and my addition to env)";
      }
  }
  </code></pre>
  
  <p>I have created a <a href="http://plnkr.co/edit/hY2OUeg9CRQ1QOz8MGU8" rel="nofollow noreferrer">simple plunk</a> to call these methods.  In my AngularJS code, I'm making two very simple $http calls.  The GET works fine.  The POST, however, always returns a "400 (Bad Request)", followed shortly in my WebStorm console by "XMLHttpRequestion cannot load ... Invalid HTTP status code 400".</p>
  
  <p>Any and all suggestions appreciated!</p>
  
  <p>EDIT!!</p>
  
  <p>Hello, and thanks for the very fast responses.  I just realized I forgot to add some very relevant detail.  </p>
  
  <p>The parameter to my POST method is what I call an Envelope object, which contains two properties: <code>listingId (int)</code>, and <code>Description (string)</code>.  When I add the urlencoded Content-Type header, and pass <code>'{"listingId":1234, "Description":"some description"}'</code> as my POST data, the env parameter in my POST method on the server is NULL (that is, it seems unable to parse the JSON I'm providing).  Sorry this was omitted from original post.</p>