[fpc-pascal] fpWeb REST support (asking about features)

Ludo Brands ludo.brands at free.fr
Tue Jun 7 16:16:27 CEST 2011


> Ok, that is simply an alternative to the current 
> TFPWebDataModule which does 
> not rely on part of the URL to determine the CRUD action, but 
> uses the URL 
> just to determine the resource, and the HTTP method to see 
> which CRUD action 
> needs to be performed.
> 
> That's easily done. It's about 5 lines of code in 
> TFPWebDataModule: 1 for a "RESTFul" property, 4 to determine 
> the action from the method if RESTFul is set to True.
> 
> Do you think this would be a useful addition ?
> 

That would indeed be a very good starting point for a REST implementation.
In the few REST implementations I have seen, the uri is used to pass on the
record identifier for the RUD action while, if I understand correctly,
TFPWebDataModule gets the record identifier together with the data from a
datainputadaptor. This will probaly need a customised datainputadaptor since
a record identifier can be anything. 
Currently I'm not involved in a REST project. Better get input from people
actively working on it before implementing anything. There are so many
implementation variations. 

Ludo




More information about the fpc-pascal mailing list