Back
.NET API Simulator
Reset
Clear
Run
Endpoint
using System; public class Program { public static void Main(string[] args) { string body = Console.In.ReadToEnd(); string name = "guest"; if (!string.IsNullOrEmpty(body)) { string marker = "\"name\""; int idx = body.IndexOf(marker, StringComparison.OrdinalIgnoreCase); if (idx >= 0) { int colon = body.IndexOf(':', idx + marker.Length); if (colon >= 0) { int firstQuote = body.IndexOf('"', colon + 1); if (firstQuote >= 0) { int secondQuote = body.IndexOf('"', firstQuote + 1); if (secondQuote > firstQuote) { name = body.Substring(firstQuote + 1, secondQuote - firstQuote - 1); } } } } } name = name.Replace("\\", "\\\\").Replace("\"", "\\\""); string json = "{\n" + " \"status\": \"ok\",\n" + " \"message\": \"Hello " + name + "\",\n" + " \"framework\": \".NET\"\n" + "}"; Console.WriteLine(json); } }
Request Body (JSON)
Route Args (space separated)
Response