My webapi method couldn't accept string parameter.
In post method in webapi controller , i could get only an optional string parameter, but when i test my method without parameter it get following error:
The parameters dictionary contains a null entry for parameter 'id' of non-nullable type 'System.Int32' for method 'System.String Get(Int32)' .
[HttpPost]
public IHttpActionResult List(string munZone="")
{
}
in route config:
routes.MapRoute(
name: "DefaultApi3",
url: "api/{controller}/{action}"
);
routes.MapRoute(
name: "DefaultApi2",
url: "api/{controller}/{action}/{id}",
defaults: new { id = UrlParameter.Optional }
);
I need to send nullable string parameter instead of int id parameter