<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Message</TITLE>

<META content="MSHTML 6.00.6000.16544" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=234223809-07062011><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><SPAN class=234223809-07062011><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=234223809-07062011><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 class=OutlookMessageHeader lang=fr dir=ltr align=left><FONT face=Tahoma 
  size=2>-----Message d'origine-----<BR><B>De :</B> 
  fpc-pascal-bounces@lists.freepascal.org 
  [mailto:fpc-pascal-bounces@lists.freepascal.org] <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 dir=ltr>
  <DIV class=gmail_quote>On Tue, Jun 7, 2011 at 10:41, <SPAN dir=ltr><<A 
  href="mailto:michael.vancanneyt@wisa.be">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 class=im><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 class=im><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 class=im><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></BLOCKQUOTE></BODY></HTML>