skip to Main Content

Why does Results.Json special-case null (and can I get it to stop doing that)?

Consider the following minimal repro example using the default ASP.NET Core template: var builder = WebApplication.CreateBuilder(args); var app = builder.Build(); // Content-Type application/json, Body: true app.MapGet("/True", () => Results.Json(true)); // Content-Type application/json, Body: "string" app.MapGet("/String", () => Results.Json("string")); // Content-Type…

VIEW QUESTION
Back To Top
Search