Ok, I thought I had this working, but... no. :)
So I am simply trying to return a CSV file from my .Net Core 2 Web API. Each time I do this I get a 406 status code...
Here is my code.
[HttpGet]
[Route("/progress/data.csv")]
[Produces("text/csv")]
public IActionResult GetCSV()
{
try
{
return Ok("1,2,3");
}
catch (Exception ex)
{
HandleError(ex);
return BadRequest(ex);
}
}
I keep thinking I need to add a formatter or something in my Startup.cs file, but that hasn't worked either.
Seems like this should be a simple request, but I am finding the interwebs sparse on this topic.
Thanks!