<div dir="ltr"><div class="gmail_quote">On Tue, Jun 7, 2011 at 12:45, Ludo Brands <span dir="ltr"><<a href="mailto:ludo.brands@free.fr">ludo.brands@free.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>
<div><span><font face="Arial" color="#0000ff" size="2">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 ;)</font></span></div></div></blockquote><div><br></div><div>What name do you think I should call it then ?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div><span><font face="Arial" color="#0000ff" size="2"> </font></span></div>
<div><span><font face="Arial" color="#0000ff" size="2"></font></span> </div>
<div><span><font face="Arial" color="#0000ff" size="2"></font></span> </div>
<blockquote dir="ltr" style="padding-left:5px;margin-left:5px;border-left:#0000ff 2px solid;margin-right:0px">
<div></div>
<div lang="fr" dir="ltr" align="left"><font face="Tahoma" size="2">-----Message d'origine-----<br><b>De :</b>
<a href="mailto:fpc-pascal-bounces@lists.freepascal.org" target="_blank">fpc-pascal-bounces@lists.freepascal.org</a>
[mailto:<a href="mailto:fpc-pascal-bounces@lists.freepascal.org" target="_blank">fpc-pascal-bounces@lists.freepascal.org</a>] <b>De la part de</b>
ik<br><b>Envoyé :</b> mardi 7 juin 2011 10:26<br><b>À :</b>
FPC-Pascal users discussions<br><b>Objet :</b> Re: [fpc-pascal] fpWeb
REST support (asking about features)<br><br></font></div><div><div></div><div class="h5">
<div dir="ltr">
<div class="gmail_quote">On Tue, Jun 7, 2011 at 10:41, <span dir="ltr"><<a href="mailto:michael.vancanneyt@wisa.be" target="_blank">michael.vancanneyt@wisa.be</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="padding-left:1ex;margin:0px 0px 0px 0.8ex;border-left:#ccc 1px solid">
<div><br><br>On Tue, 7 Jun 2011, ik wrote:<br><br>
<blockquote class="gmail_quote" style="padding-left:1ex;margin:0px 0px 0px 0.8ex;border-left:#ccc 1px solid">Hello,<br><br>One
of the thing that I find really missing in fpWeb is the ability to
have<br>support for REST.<br><br>That is, to place different callbacks to
GET, POST, UPDATE, DELETE, HEAD and<br>PUT.<br></blockquote><br></div>Why do
you think this is missing ? fpWeb does not really care about the
method.</blockquote>
<div><br>That's why it is missing :)<br> </div>
<blockquote class="gmail_quote" style="padding-left:1ex;margin:0pt 0pt 0pt 0.8ex;border-left:rgb(204,204,204) 1px solid">
<div><br><br>
<blockquote class="gmail_quote" style="padding-left:1ex;margin:0px 0px 0px 0.8ex;border-left:#ccc 1px solid">Let's
say that I create a support for the following
PATH_INFO:<br><br>/records/<br><br>The class should have support imho to
OnGet OnPost OnDelete etc..<br>So there will be separation of the code,
while the OnRequest will fire<br>anyway (if assigned) prior to each such
request.<br>That way, it will be easier to separate code, but remain
DRY.<br></blockquote><br></div>What is DRY (other than opposed to WET
?)</blockquote>
<div><br>DRY = Don't repeat yourself. so if you have to do the same task for
all of the requests, you can do them there ...<br> </div>
<blockquote class="gmail_quote" style="padding-left:1ex;margin:0pt 0pt 0pt 0.8ex;border-left:rgb(204,204,204) 1px solid">
<div><br><br>
<blockquote class="gmail_quote" style="padding-left:1ex;margin:0px 0px 0px 0.8ex;border-left:#ccc 1px solid"><br>Does
anyone else find such feature something that can be useful for them
?<br></blockquote><br></div>All you need to do is<br><br> If
Compare(ARequest.Method,'UPDATE') then<br>
DoYourUpdate(ARequest); </blockquote>
<blockquote class="gmail_quote" style="padding-left:1ex;margin:0pt 0pt 0pt 0.8ex;border-left:rgb(204,204,204) 1px solid"><br>If
you really want different events for the HTTP methods, you can make
a<br>descendent of TCustomHTTPModule which overrides HandleRequest() and
which then<br>examines the HTTP method and calls the appropriate callback
for the various HTTP methods.<br><br>It can't possibly take you more than 15
minutes to code this, plus an<br>additional 10 to register your new module
in Lazarus.<br></blockquote>
<div><br>I'll see how to do it on Lazarus, never done it before, and it's time
to learn.<br> </div>
<blockquote class="gmail_quote" style="padding-left:1ex;margin:0pt 0pt 0pt 0.8ex;border-left:rgb(204,204,204) 1px solid"><br>And
if you care to donate it, I'll put it in FPC.<br></blockquote>
<div><br>I'm now testing my implementation that I called it TFPRESTWebModule.
<br>When it will be ready I'll open a "bug" with feature and a patch, and send
here the open bug.<br> </div>
<blockquote class="gmail_quote" style="padding-left:1ex;margin:0pt 0pt 0pt 0.8ex;border-left:rgb(204,204,204) 1px solid"><br>Michael.<br></blockquote>
<div><br>Ido<br> </div>
<blockquote class="gmail_quote" style="padding-left:1ex;margin:0pt 0pt 0pt 0.8ex;border-left:rgb(204,204,204) 1px solid">_______________________________________________<br>fpc-pascal
maillist - <a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank">fpc-pascal@lists.freepascal.org</a><br><a href="http://lists.freepascal.org/mailman/listinfo/fpc-pascal" target="_blank">http://lists.freepascal.org/mailman/listinfo/fpc-pascal</a><br>
</blockquote></div><br></div></div></div></blockquote></div>
<br>_______________________________________________<br>
fpc-pascal maillist - <a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/mailman/listinfo/fpc-pascal" target="_blank">http://lists.freepascal.org/mailman/listinfo/fpc-pascal</a><br></blockquote></div><br></div>