This project is read-only.

RESTful interface?

Topics: blog, faq
Feb 22, 2011 at 2:48 PM

I have two primary purposes for embedding C# WebServer in my application:
- statically serving up a series of 'shell' application interface elements via a file handler
- dynamically interacting with the rest of my application via a RESTful interface

Thus far I have been able to exclusively react to both file GET requests, and AJAX GET requests, however I would ideally like to provide a RESTful interface through a handler, for e.g. "/api/?action=doSomething&value=12345". I'm (obviously) getting 404 errors when making calls to anything other than "/", but then when I GET to this address I am being returned the index.html file to which I mapped "/".

I will post code later this evening, but I'd like to know if there's a particular way I can assign a HTTP request handler to a URL? I haven't been able to find an example looking through the source tree.


- Peter 

Aug 9, 2012 at 8:50 PM

Ever get this figured out?  Would love to know the answer.

Aug 10, 2012 at 8:22 AM

I think a router is what you're looking for. See