2 ms·
err, super easy to return text, if you haven't used .NET for a while, this is the minimum program to return text via the end point /test var app = WebApplica
by keithnz 5y ago
err, super easy to return text, if you haven't used .NET for a while, this is the minimum program to return text via the end point /test
var app = WebApplication.CreateBuilder(args).Build();
app.Map("test", () => "hi there");
app.Run();
- jmull 5y agoOf course. So why the tortured code for the performance test? Click through to the link to the code. BTW, the link is a screenshot of the code, but that doesn't happen to show the ugly part. Could be shenanigans, could just be a minor stupidity. IDK, but it doesn't fill me with confidence in the article's general message.
- keithnz 5y agoFrom the looks, they just made a controller to return various mime types of responses, for the text they have made their own custom HTTP response, my guess is because there is no default serializer that produces text/plain (given there is no real standard for serializing into plain text)