Hi,

thank you for the patch. But I would prefer to create a more
generalized system.

In tntnet we use regular expressions to find the responder (or
component as called in tntnet). In the http server of cxxtools we have
a simple url to responder mapping. If we add this regular expression
mapper, you will be able to do something like:
  httpserver.addService(cxxtools::Regex("/foo/.*"), myservice);

Then everything starting with /foo/ will call the service. This was
already a old feature request but I have not yet realized this.


Tommi

Am Fri, 20 May 2011 22:43:28 +0200
schrieb Michael Eiler <[email protected]>:

> Hi,
> 
> I created a restful webservice using libcxxtools but I realised that
> by default the Server/Serverimpl-classes take the url and search the
> service. Normally this is not a problem but in the case of a RESTful
> webservice the parameters are part of the url. (No question mark
> '?' ).
> 
> Explained using an example:
> 
> The service is registered under "/events".
> I open the browser and send a request to /events?channel=1.
> Now the url is "/events", the default implementation finds the service
> registered under "/events" and puts the params in the qparams-string.
> 
> But in the case of a RESTful web service i want to open the url
> /events/1/.json and now the default implementation searches for a
> service registered under "/events/1/.json" which does of course not
> exist. The attached patch is a simple solution for this problem.
> 
> The patched version of libcxxtools is used in the following plugin
> for vdr: https://github.com/yavdr/vdr-plugin-restfulapi
> 
> nice regards
> Michael


------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general

Reply via email to