And of course a few minutes after posting the question I stumble upon a solution 🙂
Just return Content
with the content type application/json
…
return Content("{ \"name\":\"John\", \"age\":31, \"city\":\"New York\" }", "application/json");
More Related Contents:
- c# asp.net delete last comma [closed]
- Convert Json String to C# Object List
- How to post an array of complex objects with JSON, jQuery to ASP.NET MVC Controller?
- Web API Put Request generates an Http 405 Method Not Allowed error
- ASP.NET Core MVC : How to get raw JSON bound to a string without a type?
- Posting JSON Data to ASP.NET MVC
- How to flatten an ExpandoObject returned via JsonResult in asp.net mvc?
- Proper JSON serialization in MVC 4
- Where are the ControllerContext and ViewEngines properties in MVC 6 Controller?
- LINQ to Entities does not recognize the method ‘System.Web.Mvc.FileResult’
- Where is Request.IsAjaxRequest() in Asp.Net Core MVC?
- Ignoring a field during .NET JSON serialization; similar to [XmlIgnore]?
- ASP.NET Core v2 (2015) MVC : How to get raw JSON bound to a string without a type?
- Return JSON with error status code MVC
- Post JSON array to mvc controller
- ASP.NET Core 3.0 [FromBody] string content returns “The JSON value could not be converted to System.String.”
- Dealing with large file uploads on ASP.NET Core 1.0
- How do I transform appsettings.json in a .NET Core MVC project?
- JSON Deserialization – String Is Automatically Converted To Int
- Streaming large list of data as JSON format using Json.net
- Deserialize JSON into C# dynamic object?
- How to display indirect data in Jqgrid
- Use multiple JWT Bearer Authentication
- How to RedirectToAction in ASP.NET MVC without losing request data
- How do I access Configuration in any class in ASP.NET Core?
- Newtonsoft JSON dynamic property name
- How can I secure passwords stored inside web.config?
- How can I upload a file and save it to a Stream for further preview using C#?
- How do C# classes deal with dollar signs in JSON?
- How to convert c# generic list to json using json.net?