Skip to content

A simple HTTP REST server implementation for C#. For use as an embedded HTTP server for small projects that require the use of the HTTP GET and POST methods.

Notifications You must be signed in to change notification settings

cmdev90/SimpleHttpServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SimpleHttpServer

A simple HTTP REST server implementation for C#. For use as an embedded HTTP server for small projects.

Basic how this works snippet: 👍

WebServer app = new WebServer(3001);

app.get("/", (WebServerRequest req, WebServerResponse res) =>
{
    res.setMIMEtype("application/xml");
    res.send("<XML><MESSAGE>It works!</MESSAGE></XML>");
});

app.post("/", (WebServerRequest req, WebServerResponse res) =>
{
    string query = req.param("query");

    res.setMIMEtype("application/xml");
    res.send(string.Format("<XML><MESSAGE>Your query is below.</MESSAGE><QUERY>{0}</QUERY></XML>", query));
});

app.Start();

Helpful gist https://gist.github.com/aksakalli/9191056

About

A simple HTTP REST server implementation for C#. For use as an embedded HTTP server for small projects that require the use of the HTTP GET and POST methods.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages