I got a Web-Api project. This project is rolled out on a kestrel as a service. Now one of all my endpoints returns straight a 500, the others work fine. And the 500 I get only on kestrel, also while using kestrel local for debugging.
I empty my controller (code inside the controller class), simplified like code below. I tried changing the name. This all makes no difference. And the controller looks the same than other controller classes.
I know, it is a hard question, but where could I look for the solution of this problem that I get always a 500 response straight away?
Frank
namespace DataPicker.Api.Controllers
{
[Produces("application/json")]
[Route("api/v1/dataPicker/environmentData")]
public class TimeSeriesController : Controller
{
public TimeSeriesController(){}
[HttpPost()]
public async Task<IActionResult>
CreateAsync([FromBody]Data data)
{
return Ok("received");
}
public class Data
{
[JsonProperty("text", Required = Required.AllowNull)]
public string Text { get; set; }
}
}
}
Curl: curl -X POST "http://localhost:5000/api/v1/dataPicker/environmentData" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"text\": \"string\"}"
Response: 500, Error: Internal Server Error Response headers content-length: 0 date: Mon, 17 Jun 2019 16:18:24 GMT server: Kestrel