On Tue, Jun 7, 2011 at 10:41, <michael.vancann...@wisa.be> wrote: > > > On Tue, 7 Jun 2011, ik wrote: > > Hello, >> >> One of the thing that I find really missing in fpWeb is the ability to >> have >> support for REST. >> >> That is, to place different callbacks to GET, POST, UPDATE, DELETE, HEAD >> and >> PUT. >> > > Why do you think this is missing ? fpWeb does not really care about the > method.
That's why it is missing :) > > > Let's say that I create a support for the following PATH_INFO: >> >> /records/ >> >> The class should have support imho to OnGet OnPost OnDelete etc.. >> So there will be separation of the code, while the OnRequest will fire >> anyway (if assigned) prior to each such request. >> That way, it will be easier to separate code, but remain DRY. >> > > What is DRY (other than opposed to WET ?) DRY = Don't repeat yourself. so if you have to do the same task for all of the requests, you can do them there ... > > > >> Does anyone else find such feature something that can be useful for them ? >> > > All you need to do is > > If Compare(ARequest.Method,'UPDATE') then > DoYourUpdate(ARequest); > If you really want different events for the HTTP methods, you can make a > descendent of TCustomHTTPModule which overrides HandleRequest() and which > then > examines the HTTP method and calls the appropriate callback for the various > HTTP methods. > > It can't possibly take you more than 15 minutes to code this, plus an > additional 10 to register your new module in Lazarus. > I'll see how to do it on Lazarus, never done it before, and it's time to learn. > > And if you care to donate it, I'll put it in FPC. > I'm now testing my implementation that I called it TFPRESTWebModule. When it will be ready I'll open a "bug" with feature and a patch, and send here the open bug. > > Michael. > Ido > _______________________________________________ > fpc-pascal maillist - fpc-pascal@lists.freepascal.org > http://lists.freepascal.org/mailman/listinfo/fpc-pascal >
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal