FromBody string parameter is giving null

By declaring the jsonString parameter with [FromBody] you tell ASP.NET Core to use the input formatter to bind the provided JSON (or XML) to a model. So your test should work, if you provide a simple model class public class MyModel { public string Key {get; set;} } [Route(“Edit/Test”)] [HttpPost] public void Test(int id, [FromBody] … Read more

Multiple HttpPost method in Web API controller

You can have multiple actions in a single controller. For that you have to do the following two things. First decorate actions with ActionName attribute like [ActionName(“route”)] public class VTRoutingController : ApiController { [ActionName(“route”)] public MyResult PostRoute(MyRequestTemplate routingRequestTemplate) { return null; } [ActionName(“tspRoute”)] public MyResult PostTSPRoute(MyRequestTemplate routingRequestTemplate) { return null; } } Second define the … Read more