Posting raw JSON string with jQuery

If you are using jQuery’s ajax function to post raw JSON string to your APIs, you might get some problem when your API does not receive the correct content, or in the case of ASP.NET Web API and parameter binding, you may get null input parameters in your controller.

The JavaScript can be as simple as this.

And the post action of the Test API controller be something like below.

The post action will not get “inputparameter” as the value of variable input; instead we get a null value.
Read More