[fpc-pascal] fpWeb REST support (asking about features)
ludo.brands at free.fr
Tue Jun 7 11:45:16 CEST 2011
Please don't call it RESTsomething. REST involves much more than exposing
http methods. Just to avoid that in the future somebody complains about
missing REST features. Remember, a little while ago whe had somebody
complaining about URIParser not supporting sip uri's ;)
De : fpc-pascal-bounces at lists.freepascal.org
[mailto:fpc-pascal-bounces at lists.freepascal.org] De la part de ik
Envoyé : mardi 7 juin 2011 10:26
À : FPC-Pascal users discussions
Objet : Re: [fpc-pascal] fpWeb REST support (asking about features)
On Tue, Jun 7, 2011 at 10:41, <michael.vancanneyt at wisa.be> wrote:
On Tue, 7 Jun 2011, ik wrote:
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
Why do you think this is missing ? fpWeb does not really care about the
That's why it is missing :)
Let's say that I create a support for the following PATH_INFO:
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
If you really want different events for the HTTP methods, you can make a
descendent of TCustomHTTPModule which overrides HandleRequest() and which
examines the HTTP method and calls the appropriate callback for the various
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
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.
fpc-pascal maillist - fpc-pascal at lists.freepascal.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-pascal