Here\'s the basic setup, I have an asp.net core webapi controller (in c#) with a post function like so:
[HttpPost]
public ActionResult Post([Fr
You need a body in which json data will be parsed.
[FromBody] string Name
can not work with following json
{
"Name": "Foo"
}
It needs a class
public class MyClass
{
public string Name;
}
Then pass it as
([FromBody] MyClass obj)
Or if it is single value, use JSON like
{
[
"Foo",
"Foo1"
]
}
Then pass it as
([FromBody] List obj)