I am writing a web api in a .net core web project.
// POST: api/Companies
[HttpPost]
public void Post([FromBody]string value)
{
if (string.IsNullOrEmpty(value))
{
// inform the client that request is incorrect.
}
}
I want to be able to inform the client that its a bad request, I found many articles but all were 1-2 years old, I am sure a lot has changed since then. So wanted to know the best solution for this problem.