-
https://www.nuget.org/packages/Simple-HTTP
using SimpleHttp; using System.Threading; namespace SimpleHttpTest1 { class Program { static void Main(string[] args) { Route.Add("/", (req, res, props) => { res.AsText("Welcome to Server"); }); Route.Add("/user/{id}", (req, res, props) => { res.AsText($"You have requested user #{props["id"]}"); }, "POST"); Route.Add("/header", (req, res, props) => { res.AsText($"Value of my-header is: {req.Headers["my-header"]}"); }); HttpServer.ListenAsync( 1337, CancellationToken.None, Route.OnHttpRequestAsync ) .Wait(); } } }