I am implementing MVC web API in C #. Implementation of my snippet: - WebApiConfig.cs
config.Routes.MapHttpRoute(
name: "getMultiProbe",
routeTemplate: "api/v1/{controller}/probe/{server}"
);
config.Routes.MapHttpRoute(
name: "getCurrentMultiProbe",
routeTemplate: "api/v1/{controller}/currentmultiprobe/{server}"
);
And the controller associated with the methods that generate the problem: - HistController.cs
[HttpPost]
public Dictionary<string, List<DataSample>> getMultiProbe(string server, [FromBody] Dictionary<string,Object> request)
{
Debug.WriteLine("ENTER [GetMultiProbe] "+ request["from"] + " - mode: " + request["mode"]);
string[] tagnames = (string [])request["tagnames"];
return null;
}
[HttpPost]
public Dictionary<string, Object[]> getCurrentMultiProbe(string server, [FromBody] String[] tagnames)
{
Debug.WriteLine("ENTER [getCurrentMultiProbe] server: " + server + " - tagnames: " + tagnames);
return null;
}
from client-client returns an error:
{ "": " .", "ExceptionMessage": " , : getMultiProbe HistService.Controllers.HistController getCurrentMultiProbe HistService.Controllers.HistController", "ExceptionType": "System.InvalidOperationException", "StackTrace": " System.Web.Http.Controllers.ApiControllerActionSelector.ActionSelectorCacheItem.SelectAction(HttpControllerContext controlContext) System.Web.Http.Controllers.ApiControllerActionSelector.SelectAction(HttpControllerContext controlContext) System.Web.Http.ApiController.ExecuteAsync(HttpControllerContext controllerContext, CancellationToken cancelationToken) System.Web.Http.Dispatcher.HttpControllerDispatcher.d__1.MoveNext()" }
, /currentmultiprobe /probe. . , .