Please read this part, number 3 in particular: http://encosia.com/using-jquery-to-post-frombody-parameters-to-web-api/ 3. [FromBody] parameters must be encoded as =value (quoting the section for future reference:)
There are two ways to make jQuery satisfy Web API’s encoding requirement. First, you can hard code the = in front of your value, like this:
$.post('api/values', "=" + value);
Personally, I’m not a fan of that approach. Aside from just plain looking kludgy, playing fast and loose with JavaScript’s type coercsion is a good way to find yourself debugging a “wat” situation.
Instead, you can take advantage of how jQuery encodes object parameters to $.ajax
, by using this syntax:
$.post('api/values', { '': value });