using Microsoft.AspNetCore.Mvc; namespace WarhoundConsole { [ApiController] [Route("api/test")] public class Test : ControllerBase { [HttpGet("hello")] public ActionResult GetGreeting() { string message = "Hello!!!"; if (message.Length != 0) { //throw new Exception("Hello"); } return Ok(message); } [HttpGet("data")] public ActionResult GetData() { var data = new { Id = 1, Name = "Sample Data", Timestamp = DateTime.UtcNow }; return Ok(data); } [HttpPost("json")] public ActionResult asd([FromBody] object obj) { //if (obj == null) //{ // return BadRequest("Invalid data."); //} Console.Write(obj.ToString()); return Ok(new { a = 1, b = 2, c = "c" }); } } }