Trying to replicate a Framework API using .NET Core 6 and minimal APIs.
One thing is I am getting "application/json" as the content-type if I return Results.Ok(data)
.
Yes it should be json, but this is replicating legacy functionality.
I can get the results to be text/plain if I just use return data;
.
But would like to use Results
if I can.
Setting this does not work:
context.Response.ContentType = "text/plain";
return Results.Ok(data);
Still comes back application/json
.
Any suggestions?